stg-tud/tigerseyeplugin — Issue #32: Newlines added after first semicolon in a dsl file may break the output (groovy) file
Author: pablohoch
Created: 2011-11-24 13:52:02+00:00
State: open

Apparently, during transformation, two newlines are inserted after the first semicolon in a .dsl file, regardless of where the semicolon appears. This can produce an invalid Groovy file that does not compile, for example when the semicolon appears inside a string.

Here is a simple example .dsl file where the problem can be reproduced (the problem seems to be DSL-independent):

```groovy
package de.tud.stg.tigerseye.examples.set

set(name:'SemicolonTest'){
println "hello;world"
println "hello;world"
}
```

This file gets transformed into:

```groovy
package de.tud.stg.tigerseye.examples.set

import de.tud.stg.tigerseye.examples.setdsl.SetDSL;
import de.tud.stg.tigerseye.dslsupport.DSLInvoker;
DSLInvoker.eval([
SetDSL.class]){
println "hello;

world"
println "hello;world"
}
```

Other examples where this replacement breaks the resulting Groovy file are [Cons1Test.sdf.dsl](https://github.com/stg-tud/tigerseyeplugin-examples/blob/master/de.tud.stg.tigerseye.sdfdsl.languagetestbench/src/sdf/test/dsl/ConsTest1.sdf.dsl) and [ImportTest.sdf.dsl](https://github.com/stg-tud/tigerseyeplugin-examples/blob/master/de.tud.stg.tigerseye.sdfdsl.languagetestbench/src/sdf/test/dsl/ImportTest.sdf.dsl) (in both files, the first semicolon appears inside a string). These files were correctly transformed using revision b6f07f2ff6115c989b342503a911133122faa2fa, so it looks like this change was introduced in the last few days.

Since this only seems to affect the first semicolon in the input file, something like the following can be used as workaround:

```groovy
package de.tud.stg.tigerseye.examples.set

; // workaround
set(name:'SemicolonTest'){
println "hello;world"
println "hello;world"
}
```