MPS-extensions icon indicating copy to clipboard operation
MPS-extensions copied to clipboard

Add separator functionality

Open eugenschindler opened this issue 5 years ago • 2 comments

From mps-plaintextgen created by eugenschindler: DSLFoundry/mps-plaintextgen#13

For generating lists, it is useful to have something like the separators in MPS textual editors.

eugenschindler avatar Apr 07 '19 17:04 eugenschindler

This has been +1'd by MPS power users

eugenschindler avatar Apr 07 '19 17:04 eugenschindler

Is there still no way to do this easily? I found the following workaround for looping over children with a (non-trailing) separator:

image

The VAR macro captures the node's children in a variable over which the LOOP macro loops. That LOOP macro is also set up to use a counter variable: image

Then, the IF macro only inserts the separator (a dot here) if the counter is small enough: image

Is there any easier workaround?

ComFreek avatar Jun 18 '20 16:06 ComFreek