It would be useful if Template lang subtracted the indentation of the opening bracket from the indentation of the whole template.
E.g. currently

	Receive.Receive =		
<receive <Expression> of
	<CrClause+; separator=";\n"><AfterPart>
end>

is the correct solution if you to express that the receive and end 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 receive line not being indented, the inner lines being indented a lot and the end line being indented slightly less

Submitted by Barnabás Králik on 25 June 2013 at 10:03

On 25 June 2013 at 10:19 Guido Wachsmuth commented:

Can you please give a code example of the expected indentation and the one you actually get?


On 25 June 2013 at 13:27 Barnabás Králik commented:

I would expect

  receive A of
      a ->
            b
  end.

but I get

  receive A of
        a ->
              b
      end.

On 25 June 2013 at 14:02 Guido Wachsmuth commented:

Does the situation change if you add a space in front of the end, that is align end with receive in the template?


On 29 June 2013 at 15:25 Barnabás Králik commented:

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.


On 29 June 2013 at 15:32 Guido Wachsmuth commented:

I meant an additional space, as in

 Receive.Receive =   
   <receive <Expression> of
     <CrClause+; separator=";\n"><AfterPart>
    end>

Note how end aligns with receive, not with <.


On 29 June 2013 at 22:13 Barnabás Králik commented:

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.


On 29 June 2013 at 22:21 Guido Wachsmuth commented:

Thank you for clarification.


On 29 June 2013 at 22:22 Guido Wachsmuth tagged sdf

On 29 June 2013 at 22:22 Guido Wachsmuth tagged spoofaxlang

On 30 June 2013 at 15:36 Eelco Visser commented:

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 =


On 10 July 2013 at 22:57 Oskar van Rest commented:

This one should also work and looks prettier:

Receive.Receive = 
  <
    receive <Expression> of
      <CrClause+; separator=";\n"><AfterPart>
    end
  >

On 10 July 2013 at 23:22 Eelco Visser commented:

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?


On 11 July 2013 at 01:32 Oskar van Rest commented:

Yes it actually does work.


On 11 July 2013 at 10:15 Barnabás Králik commented:

Thanks for the help; these really do work!

Log in to post comments