bnfc icon indicating copy to clipboard operation
bnfc copied to clipboard

Warn if numbered category variants exist outside of `coercions` range

Open andreasabel opened this issue 4 years ago • 1 comments

The pragma e.g. coercions Exp 3 should issue a warning if the grammar contains variants of Exp outside of the range 1-3. This is more likely a mistake than intention. Often, there is confusion if the variant with the least precedence is Exp or Exp0. Also, a user might have added more higher precedences without updating the coercions pragma.

andreasabel avatar Jan 26 '21 20:01 andreasabel

There seems to be a use case for variants without coercions, see: https://github.com/BNFC/bnfc/blob/3a5980285494270531df9defa65524f23482217f/examples/define/test.cf#L32-L40 https://github.com/BNFC/bnfc/blob/3a5980285494270531df9defa65524f23482217f/examples/define/test.cf#L46-L46

andreasabel avatar Jun 07 '21 17:06 andreasabel