Grammars have implicit start symbols
This commit is contained in:
parent
57de8a5b85
commit
a7b4a3ce8b
2 changed files with 18 additions and 5 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue