| Summary: | separator('\n') uses linux line separator instead of system line separator | ||
|---|---|---|---|
| Product: | [Modeling] Acceleo | Reporter: | Laurent Delaigue <laurent.delaigue> |
| Component: | Core | Assignee: | Project Inbox <acceleo-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | stephane.begaudeau, william.piers |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
This mechanism is very straightforward we are just putting the content of "separator" after each call to the for. We could detect that the separator contains a line separator and then replace it with the OS specific line separator. "->sep'\n')" should work the same way. Acceleo 3.3.0 will provides two ways to handle problems with line separators. A new operation defined on String and returning a Sequence(String) is available to split a block of text at each line separator. This way a block of text from a model or a properties file using OS specific line separator can be generated with something like this:
[for (line: String | myBlock.tokenizeLine())]
[line/]
[/for]
Another operation defined an OclAny and as such available for every element during the generation (like getProperty('')) will let user get the currently used line separator so in your case you would write something like this:
[for (...) separator(lineSeparator())]x[/for]
When running inside of Eclipse, we will use the Eclipse defined line separator if it has been set by the user in the preferences, the OS specific line separator will be used otherwise. This access to the value of the line separator is defined as an operation and not as a variable for various implementation and tooling reasons (and the drawback, two parenthesis, is not that bad).
*** Bug 366058 has been marked as a duplicate of this bug. *** Closing resolved bugs |
Build Identifier: 3.1.0.v20110607-0602 When I use a [for (...) separator('\n')]x[/for] I get linux line separator even though I'm using windows. I would expect the line separator used to be the system line separator... I haven't checked with ->sep('\n') Reproducible: Always