BNFC / bnfc

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

BNFC does not allow empty declarations in .cf files #215

Closed andreasabel closed 6 years ago

andreasabel commented 6 years ago

BNFC (haskell) accepts totally empty input files, but not

;

It should also allow empty declarations consisting just of a ;. This would allow a style like

-- comment
; Rule. S ::= P
-- comment
; Rule2. S ::= Q

where semicolons are aligned at the first column.

andreasabel commented 6 years ago

This can be fixed by defining custom Def lists with the extra rule:

_. [Def] ::= ";" [Def] ;