diff options
Diffstat (limited to 'LinkedNode.py')
-rw-r--r-- | LinkedNode.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/LinkedNode.py b/LinkedNode.py index 864f708..88bc6da 100644 --- a/LinkedNode.py +++ b/LinkedNode.py @@ -59,7 +59,12 @@ class LinkedNode(object): # the node appears to have an own variable scope if defined_names is None: raise RuntimeError("No object found for storing variables") - self.variables = Variables(defined_names, parent_variables) + # pass function object for local variables allocation + function = self.getFunctionNode() + if function: + function = function.function + self.variables = Variables(parent_variables, defined_names, + function=function) # Identifiers which are in use (think of variables and labels) self.defined_names = defined_names if not self.variables: @@ -93,7 +98,7 @@ class LinkedNode(object): "Enum", # enum type "Enumerator", # enum value "EnumeratorList", # list of enum values - "FuncDecl", "Goto", "Label", "ParamList", "PtrDecl", "Struct", + "Goto", "Label", "ParamList", "PtrDecl", "Struct", "TypeDecl", "Typedef", "Union") def getStatementNode(self): """Returns the nearest LinkedNode which is a statement node type""" |