Grammars have implicit start symbols

This commit is contained in:
John Doty 2024-05-31 06:29:57 -07:00
parent 57de8a5b85
commit a7b4a3ce8b
2 changed files with 18 additions and 5 deletions

View file

@ -54,8 +54,10 @@ RSQUARE = Terminal("RightBracket")
class FineGrammar(Grammar):
def __init__(self):
super().__init__(
start="File",
precedence=[
(Assoc.RIGHT, [EQUAL]),
(Assoc.LEFT, [OR]),
@ -73,7 +75,7 @@ class FineGrammar(Grammar):
# statement or an expression, prefer the statement.
#
(Assoc.NONE, [self.if_statement]),
]
],
)
@rule("File")