From cb8402018fb2ff7b7eb5fdd289ca33305556c750 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 31 Aug 2011 10:56:23 -0400 Subject: [PATCH] fix a few bugs parsing functions --- parser/Parser.py | 4 ++-- parser/nodes.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/parser/Parser.py b/parser/Parser.py index cd7a5d2..d191379 100644 --- a/parser/Parser.py +++ b/parser/Parser.py @@ -49,11 +49,11 @@ class Parser(object): def p_function(self, p): 'function : type ID LPAREN RPAREN LCURLY function_items RCURLY' - p[0] = FunctionNode(p[2], p[1], None, p[6]) + p[0] = FunctionNode(p[2], p[1], None, p[6].children) def p_function_items(self, p): 'function_items : function_item function_items' - p[0] = Node([p[1] + p[2].children]) + p[0] = Node([p[1]] + p[2].children) def p_function_items_empty(self, p): 'function_items : empty' diff --git a/parser/nodes.py b/parser/nodes.py index da109ef..a29deda 100644 --- a/parser/nodes.py +++ b/parser/nodes.py @@ -27,7 +27,8 @@ class UnitNode(Node): Node.__init__(self, children) class FunctionNode(Node): - def __init__(self, name, ret_type, children=None): + def __init__(self, name, ret_type, param_list, children=None): Node.__init__(self, children) self.name = name self.ret_type = ret_type + self.param_list = param_list