MPS-extensions
MPS-extensions copied to clipboard
Vertical alignment in nested layouts
From mps-plaintextgen created by nkoester: DSLFoundry/mps-plaintextgen#26
I face the issue of not being able to specify the vertical alignment of text within nested layouts.
A simple example of this would be any generator that uses e.g.
[> $LOOP$[> [> $COPY_SRC$element <] $IF$, <] <]
as a generator structure in order to separate nested lines with a comma.
However, if nested lines themselves have multiple lines as a result, this construct fails. The plaintextgen will always put the comma on the same (first) line.
Example:
This is where I'd like to generate it to:
I suggest adding something like a vertical alignment to make these kind of constructs possible.
Sorry, the last one slipped through the cracks. Could you make an MPS project example? That would help more with understanding the issue.
Maybe take a look at the json language [1]. The above screenshots where taken from it and there is not much more to it than what is shown there.
[1] ttps://github.com/nkoester/mps-json
Any thoughts or updates on this?
Maybe you can have a look at the plaintextflow language (which is also in the plaintextgen plugin and has some extra constructs to handle nesting and newlines). Would that solve your issue?