BNFC / bnfc

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

Incomplete prtList with delimiters #106

Closed gdetrez closed 3 years ago

gdetrez commented 10 years ago

With the following example:

S. S ::= "#" [A] ;
A. A ::= "a" ;
delimiters A "[" "]"  separator "," ;
$ bnfc --haskell --cnf -m test.cf && make
$ echo "# [ a ]" | ./TestCNF

You get TestCNF: Printtest.hs:(92,16)-(93,64): Non-exhaustive patterns in case because the following doesn't have a case for a non empty list:

 prtList es = case es of
   [] -> (concatD [doc (showString "[") , doc (showString "]")])
andreasabel commented 3 years ago

The delimiters pragma has been removed in 2.9.0.