-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Consider this script:
import jsgf
grammar = jsgf.parser.parse_grammar_string("""
#JSGF V1.0 utf-8 en;
grammar main;
public <main> =
foo (bar|baz) qux | xxx;
""")
print(grammar.get_rule("main").compile())I would expect the output to be public <main> = foo (bar|baz) qux|xxx;, or possibly something along the lines public <main> = (foo (bar|baz) qux)|(xxx); with additional parentheses to disambiguate.
Instead, I get public <main> = foo (bar|baz) (qux|xxx);. Is this expected behavior? I'm not an expert by far on JSGF, but going by the spec, | should have the lowest precedence of all, which doesn't seem compatible with this result.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels