diff options
-rwxr-xr-x | pp2cc.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -754,6 +754,11 @@ class Parse(object): # } lines.append(self.asm.noop(lbl_for_end)) return lines + def parseExprList(self, linked_node): + lines = [] + for expr in linked_node.node.exprs: + lines += self.parseStatement(expr, linked_node) + return lines def parseStatement(self, node, parent_linked_node, level_increment=False): linked_node = LinkedNode(node, parent_linked_node, level_increment=level_increment) self.asm.level = linked_node.level @@ -762,8 +767,6 @@ class Parse(object): raise RuntimeError("Not implemented for type " + repr(node)) elif isinstance(node, c_ast.Decl): self.defineGlobalVar(linked_node, parent_linked_node) - elif isinstance(node, c_ast.ExprList): - raise RuntimeError("Not implemented for type " + repr(node)) elif isinstance(node, c_ast.FuncDecl): raise RuntimeError("Not implemented for type " + repr(node)) elif isinstance(node, c_ast.PtrDecl): @@ -771,7 +774,7 @@ class Parse(object): else: for entry in ("Compound", "BinaryOp", "If", "Constant", "ID", "Return", "FuncCall", "UnaryOp", "Cast", - "TernaryOp", "DoWhile", "While", "For"): + "TernaryOp", "DoWhile", "While", "For", "ExprList"): if isinstance(node, getattr(c_ast, entry)): lines += getattr(self, "parse" + entry)(linked_node) break |