Closed ashtonsix closed 2 years ago
It is my expectation that this grammar:
@top Program { Term[@export] { "." } }
Would produce a terms file like this (or throw an error):
export const Program = 1, Term = 2
But it actually produces a terms file like this:
export const Program = 1
For comparison, here is a grammar that produces the expected terms file:
@top Program { Term } Term[@export] { "." }
This is by design, because you can have multiple inline rules with the same name. Move them to the top level to export them.
Attached patch adds a warning when you do this.
It is my expectation that this grammar:
Would produce a terms file like this (or throw an error):
But it actually produces a terms file like this:
For comparison, here is a grammar that produces the expected terms file: