|[XPAND] Need for formatting commands? [message #505859]
||Tue, 05 January 2010 11:41
| Erhard Weinell
Registered: January 2010
Location: Kassel, Germany
|Does XPAND need format commands?[ 0 votes ]|
|1.||No (e.g. I prefer external pretty printing)|| 0 / 0%|
|2.||Yes - pressing issue|| 0 / 0%|
|3.||Yes - long term goal|| 0 / 0%|
in its current state, XPAND only features few means for code formatting, mainly the option to suppress newlines. Personally, I like to write templates in a way that the generated code is easily readable 'as is', mainly for two reasons:
- I do not need to provide an own pretty printer for not-so-common target languages. Especially there are still needs to generate properly formatted SQL or, even worse, SQL-strings embedded into Java.
- the code is readable even if it is syntactically incorrect, which makes it easier to locate template errors. Some pretty printers tend to refuse formatting malformed code.
Whilst properly placed newlines and spaces are more or less a matter of fine-tuning templates, I miss support for indenting code regions. Especially, one cannot know the proper indentation depth of a member declaration, taking nested qualifiers into account. Up to now one can only "simulate" indented regions by writing such code to an extra "buffer" outlet and by merging this buffer back into the real file afterwards. Of course this makes templates really ugly unless the complex syntax is hidden from the template developer.
Would you consider formatting commands such as indented regions a valuable addition to XPAND? Do you suggest other formatting commands?
Powered by FUDForum
. Page generated in 0.02050 seconds