-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
- parglare version: 0.18.0
- Python version: 3.12.3
- Operating System: Linux 6.8.7-arch1-2 x86_64
Description
When two grammar files import the same file (lets say root imports a and b, and a imports b), one file (root) will have a different "version" (root.b) of the imported file (b) from the other file (a, root.a.b)
When the first file overrides a terminal in the imported file, the second terminal should, in theory, use that override (a.b.B), however it does not (b.B)
What I Did
root.pg
import './a.pg' ;
import './b.pg' ;
start: a.a ;
terminals
b.B: 'C' ;
a.pg
import './b.pg' ;
a: b.B ;
b.pg
terminals
B: 'B' ;
Given the above examples, upon constructing the grammar (parglare.Grammar.from_file('./root.pg')), the terminals are as such:
b.Ba.b.B
I would expect there to be only one, a.b.B, as having each import potentially separate makes overriding complex multi-file grammars much more difficult.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels