Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wishlist: PrettyPrinting "line break within list" #8

Open
inkytonik opened this issue Jun 14, 2020 · 1 comment
Open

Wishlist: PrettyPrinting "line break within list" #8

inkytonik opened this issue Jun 14, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@inkytonik
Copy link
Owner

Peter Höfner says:

this is a super minor issue. It's about Pretty printing. I would love to have a line break (\n) after every item of a list. That means I would like to have something like Example = '' nestnl(Lst)\n ''. Lst = 'Item,'\n'Item'. where Lst should be replaced by a list.

I can write Example = '' nestnl(Lst2)\n ''. Lst2 = Item++',\n'. which has two draw backs (a) it requires a line break for parsing as well (not only when pretty printing) (b) the outcome looks like " Item, Item "; that means nesting is not preserved.

Again: really only on my wish list; nothing major.

@inkytonik
Copy link
Owner Author

It's not exactly what you suggest, but have you tried the {line} directive on rules? Here is the description from the docs:

A common situation arises when you want to place all instances of a construct on separate lines (unless they fit together). To specify this behaviour you can add a line annotation to the relevant rule. It is equivalent to placing a \n at the beginning of each alternative in the rule.

Stm {line} = ...

@inkytonik inkytonik added the enhancement New feature or request label Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant