parse_tree: Remove Pratt parser

It isn't actually needed; the way we parse expressions as a prefix
followed by zero or more suffixes is enough.
This commit is contained in:
James Westman 2023-03-11 21:05:27 -06:00
parent 9fcb63a013
commit 8874cf60b3
3 changed files with 6 additions and 68 deletions

View file

@ -23,7 +23,7 @@ from .types import TypeName
from .gtkbuilder_template import Template
expr = Pratt()
expr = Sequence()
class Expr(AstNode):
@ -200,9 +200,6 @@ class ClosureExpr(Expr):
expr.children = [
Prefix(ClosureExpr),
Prefix(IdentExpr),
Prefix(["(", ExprChain, ")"]),
Infix(10, LookupOp),
Infix(10, CastExpr),
AnyOf(ClosureExpr, IdentExpr, ["(", ExprChain, ")"]),
ZeroOrMore(AnyOf(LookupOp, CastExpr)),
]