Template lang should take indentation of template lang code in account when calculating indentation
It would be useful if Template lang subtracted the indentation of the opening bracket from the indentation of the whole template.
E.g. currentlyReceive.Receive = <receive <Expression> of <CrClause+; separator=";\n"><AfterPart> end>
is the correct solution if you to express that the
receive
andend
lines are not to be indented, but the enclosed lines are to be indented. This makes the template lang code look ugly and does not allow for expressing negative indentations.It would be nice if the following temp lang code had the same effect:
Receive.Receive = <receive <Expression> of <CrClause+; separator=";\n"><AfterPart> end>
In the current implementation this results in the
Submitted by Barnabás Králik on 25 June 2013 at 10:03receive
line not being indented, the inner lines being indented a lot and theend
line being indented slightly less
Issue Log
Can you please give a code example of the expected indentation and the one you actually get?
I would expect
receive A of a -> b end.
but I get
receive A of a -> b end.
Does the situation change if you add a space in front of the end, that is align end with receive in the template?
No, it does not. Actually leading whitespace is consistently 1 TAB followed by spaces where necessary; however, if I change it to a number of spaces, the situation still does not improve.
I meant an additional space, as in
Receive.Receive = <receive <Expression> of <CrClause+; separator=";\n"><AfterPart> end>
Note how
end
aligns withreceive
, not with<
.
Oops, my comment has been a bit misleading.
I did this exactly. The lines had 4,4,9,5 spaces between beginning-of-line and the first nonwhitespace characters. and the output was still incorrect.
Thank you for clarification.
It turns out that the following variation does work correctly:
Receive.Receive = <
receive of
<CrClause+; separator=“;\n”>
end>
Note that<
on the same line as the=
This one should also work and looks prettier:
Receive.Receive = < receive <Expression> of <CrClause+; separator=";\n"><AfterPart> end >
Well, one can argue about prettyness (I don’t like the single < on a line by itself).
By should also work, do you mean that it does currently work, or that you think it ought to work, but currently does not?
Yes it actually does work.
Thanks for the help; these really do work!
Log in to post comments