Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions symbols/bound.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def make_node(lower, upper, lineno):
syntax_error(lineno, 'Array bounds must be constants')
return None

while isinstance(lower, SymbolVAR):
if isinstance(lower, SymbolVAR):
lower = lower.value
if lower is None: # semantic error
syntax_error(lineno, "Unknown lower bound for array dimension")
return

while isinstance(upper, SymbolVAR):
if isinstance(upper, SymbolVAR):
upper = upper.value
if upper is None: # semantic error
syntax_error(lineno, "Unknown upper bound for array dimension")
Expand Down
3 changes: 3 additions & 0 deletions symbols/var.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def value(self):
""" An alias of default value, only available is class_ is CONST
"""
assert self.class_ == CLASS.const
if isinstance(self.default_value, SymbolVAR):
return self.default_value.value

return self.default_value

@value.setter
Expand Down