BNFC / bnfc

BNF Converter
http://bnfc.digitalgrammars.com/
586 stars 165 forks source link

Not to have line changes before and after { and } #93

Closed kyagrd closed 10 years ago

kyagrd commented 10 years ago

Curly braces in BNFC are considered too special. They seem to be always considered as begin and end marks for block of sequences (often surrounding the seuqnece of things separated by a sperator).

However, { } are often used otherwise, for example, the notation for Agda's implicit agrument uses curly braces, but nothing to do with a block that should print out with line changes.

I think there must be a way to disable { } from being considered as a surronding mark of a block. Same questions have been posted to the BNFC maing list before.

kyagrd commented 10 years ago

Found an answer myself.

Defining your own render and printTree seems to work.

I think this should be an FAQ. I found the same question in this mailing list.