Page 1 of 1

OperationException: Bad indent in miniyaml

Posted: Sun Mar 27, 2011 12:08 am
by PhoibDS
While I am an avid advocate of indenting, the current indenting is enforced too rigid. Whenever I have a row of spaces hidden in the tabs (which can happen a lot when you use a mouse in vi) it breaks the code.

But it does not just break the code, it also hides it. Before I get to the indentation error, I get a row of unable to load field [bla] of type[blabla], after the indentation error, hiding the fact that there is such an error as root cause of the crash.

So please, use less strict indentation, because now it is frustrating to retab your vehicle all the time.

Posted: Sun Mar 27, 2011 2:55 am
by beedee
The whitespace is syntactically significant, the same as Python or Haskell. We can't relax the indentation otherwise it won't work.

Posted: Sun Mar 27, 2011 12:17 pm
by PhoibDS
Alright, then give me a few minutes.

Posted: Tue Mar 29, 2011 8:04 am
by Sleipnir
I did some testing and it looks like our yaml loading was broken at some point in the past.

It used to accept any amount of whitespace for child nodes, provided it was consistent (if a parent is indented by 4 spaces, then its child must be indented by 4 spaces, and then at least one more whitespace character - indenting the child with two tabs won't work since you remove the semantic link to its parent).

I'll add a bug to the tracker on this, but to be honest its not a high priority and so probably won't be fixed any time soon.