1

implement parenthesis for expressions

This commit is contained in:
Christoph
2021-08-11 21:17:36 +02:00
parent 3a6814a850
commit 8acc26f8f3
2 changed files with 16 additions and 1 deletions

View File

@ -175,10 +175,15 @@ def sugar(expr):
if len(expr) == 2:
return build_methodcall([op, []], simpleast.PrimitiveMethodCall, expr[0]) # ([name, arg], class, receiver)
return build_methodcall([op, [expr[2]]], simpleast.PrimitiveMethodCall, expr[0]) # ([name, arg], class, receiver)
@pg.production("expression : OpenBracket expression CloseBracket")
def sugar_parenthesis(expr):
return expr[1]
@pg.production("msg-chain : methodcall")
@pg.production("msg-chain : methodcall msg-chain")
def msg_chain(cc):