|
Re: Text Production Rules [message #686595 is a reply to message #686515] |
Wed, 22 June 2011 15:04 |
|
Hi Dharam,
"trim()" removes the leading and trailing spaces from a given String. In your case, the tab that will be removed by the "post(trim())" of findAssoc is the very first tab (which is located on line 6 of the PatternGen module). In that case, trimming won't help you.
These are the only ways I see to fix the issue :
- Rethink the indentation of the findAssoc template
- Change the line so that it is trimmed :
[('<tabs>' + ':' + ref.name).trim()/]
- Use post(replaceAll('\\n(\\t*)', '\\n')) to manually remove all tabulations from the beginning of each lines of that templates' output (not recommended for readability or if you may need traceability on that module)
- Split findAssoc in two so that the offending line is the first line actually generating text of one template on which you could call "post(trim())"
There isn't much that can be done here. Acceleo focuses more on the indentation of the generated text than on the indentation of the modules themselves.
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.03433 seconds