lukaslueg / railroad_dsl

A small DSL to generate syntax diagrams
MIT License
35 stars 7 forks source link

are commas necessary? #2

Closed birkenfeld closed 6 years ago

birkenfeld commented 6 years ago

It seems to me that the commas between items are redundant and could be omitted, which would give a little less visual clutter.

lukaslueg commented 6 years ago

They are, although I'm unsure if the clutter is less or more:

["DEFAULT", <'signed-number', 'literal-value', ["(", 'expr', ")"]>],

vs.

["DEFAULT" <'signed-number' 'literal-value' ["(" 'expr' ")"]>]

I'm under the impression that the second example runs the risk of visually gluing the elements together, although I have no strong opinion on this. If you can make the examples parse with the commas removed from the language, I'd be fine with it.