From 57447098b3fc30f1e34160a75660398359f44f68 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 11 Aug 2021 21:21:39 +0200 Subject: [PATCH] upd --- de.churl.simple/simpleparser.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/de.churl.simple/simpleparser.py b/de.churl.simple/simpleparser.py index a413802..dc77364 100644 --- a/de.churl.simple/simpleparser.py +++ b/de.churl.simple/simpleparser.py @@ -154,7 +154,6 @@ def expression(expr): return expr[0] -# TODO: Parenthesis # Syntactic Sugar: Plus, Minus, Multiply, Divide, Modulo, Increment @pg.production("expression : expression Plus expression") @pg.production("expression : expression Minus expression") @@ -173,10 +172,10 @@ def sugar(expr): "Increment": "$int_inc" }[expr[1].name] - if len(expr) == 2: + if len(expr) == 2: # unary operator 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) + return build_methodcall([op, [expr[2]]], simpleast.PrimitiveMethodCall, expr[0]) @pg.production("expression : OpenBracket expression CloseBracket")