|
@@ -13,7 +13,7 @@ class DeclareFunctionsVisitor(Visitor):
|
|
|
def compute_parameter_types(self, tree):
|
|
|
parameter_types = []
|
|
|
for parameter in tree.get_children('parameter'):
|
|
|
- type_specifier = parameter.get_tail()[2].get_text()
|
|
|
+ type_specifier = parameter.get_children("type_specifier")[0].get_text()
|
|
|
parameter_types.append(types_mv.string_to_type(type_specifier))
|
|
|
return parameter_types
|
|
|
|
|
@@ -23,7 +23,7 @@ class DeclareFunctionsVisitor(Visitor):
|
|
|
return func_type
|
|
|
|
|
|
def visit_funcdecl(self, tree):
|
|
|
- func_name = tree.get_tail()[2].get_text()
|
|
|
+ func_name = tree.get_children("func_name")[0].get_text()
|
|
|
func_type = self.compute_func_type(tree)
|
|
|
parameter_types = self.compute_parameter_types(tree)
|
|
|
self.set_type(tree, func_type)
|