From 398443f1e29b2f999c953879a91269724dd7c941 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 28 Dec 2020 18:01:43 -0700 Subject: properly parse parenthesized atomic expressions --- crowbar_reference_compiler/ast.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crowbar_reference_compiler/ast.py b/crowbar_reference_compiler/ast.py index 7ae7ff9..cf12a2f 100644 --- a/crowbar_reference_compiler/ast.py +++ b/crowbar_reference_compiler/ast.py @@ -607,6 +607,8 @@ class ASTBuilder(NodeVisitor): return body def visit_AtomicExpression(self, node, visited_children) -> Expression: + while isinstance(visited_children, list) and len(visited_children) == 1: + visited_children = visited_children[0] if isinstance(visited_children, list) and len(visited_children) == 3: lparen, body, rparen = visited_children assert lparen.type == '(' -- cgit v1.2.3