You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a grammar file I am importing from another one. I am using the default actions for all rules. I want to use named matches in the rules of the imported grammar file. When I add named matches to any rule in the imported file, I get an exception when parsing. Since the grammar worked as expected before I added the named matches, I expected it to work after adding them, as well.
What I Did
To reproduce the error, first, create two files, one named "main.pg" and one named "imported.pg". The contents of the files are as follows:
main.pg:
import "imported.pg";
ROOT: imported.ROOT;
imported.pg:
ROOT: A | B;
A: 'a';
B: b='b';
Now, if you load "imported.pg" into a grammar and use it directly, everything works as expected:
Thanks for the report. I've verified it is a bug. It seem it gets triggered only when assignment is used, i.e. the b='b' in 'B' rule seems to be the culprit.
Description
I have a grammar file I am importing from another one. I am using the default actions for all rules. I want to use named matches in the rules of the imported grammar file. When I add named matches to any rule in the imported file, I get an exception when parsing. Since the grammar worked as expected before I added the named matches, I expected it to work after adding them, as well.
What I Did
To reproduce the error, first, create two files, one named "main.pg" and one named "imported.pg". The contents of the files are as follows:
main.pg:
imported.pg:
Now, if you load "imported.pg" into a grammar and use it directly, everything works as expected:
However, if you load "main.pg", you get a surprise:
The text was updated successfully, but these errors were encountered: