String interpolation does not take tabs on the left into account. For example in the entity language the generator:

to-java:
	Module(x, d*) ->
	$[ package [x];
		 
		 [d'*]
	 ]
	with
		d'* := <to-java> d*

to-java:
	Entity(x, p*) ->
	$[ class [x] {
				 [p'*]
		 }
	 ]
	with
		p'* := <to-java> p*

produces too much spacing (1 space and 3 tabs instead of 1 tab):

	class User {
	 			 
	 			private String name;

while this generator:

	to-java:
		Module(x, d*) -> 
$[package [x];

[d'*]]
		with
			d'* := <to-java> d*
	
	to-java:
		Entity(x, p*) -> 
$[class [x] {
	[p'*]
}

]

produces correct spacing:

class User {
	private String name;

If I recall correctly this feature used to be working in the past, but I’m not sure so I’ll check it against the stable version.

Submitted by Gabriël Konat on 26 July 2013 at 01:45

On 26 July 2013 at 01:55 Gabriël Konat commented:

This indeed used to work in stable. The problem seems to be that string interpolation doesn’t ignore tabs on the left side, it only ignores spaces. I will change the entity project to use spaces in that file again, but this issue should still be solved.


On 26 July 2013 at 01:57 Gabriël Konat tagged minor

On 26 July 2013 at 02:08 Vlad Vergu commented:

Do you have any ideas of what might be causing this? I wonder if this was introduced with the new StrategoXT. Build http://hydra.nixos.org/build/5429804 was the last Spoofax build to contain the C built StrategoXT.


On 26 July 2013 at 02:11 Gabriël Konat commented:

I copied the generate.str from the Entity project generated in stable to the Entity project generated in nightly and it properly took care of spacing, so even in nightly with bootstrapped StrategoXT string interpolation properly ignores spaces on the left hand side, but not tabs. However, I did not try using tabs in stable.

Log in to post comments