Skip to content

Commit

Permalink
Fix: Use a most likely defined position when reporting error (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 committed Jul 17, 2021
1 parent 5e6ee73 commit 60cb27d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nml/actions/action2var.py
Expand Up @@ -479,9 +479,9 @@ def parse_variable(self, expr):
@type expr: L{expression.Variable}
"""
if not isinstance(expr.num, expression.ConstantNumeric):
raise generic.ScriptError("Variable number must be a constant number", expr.num.pos)
raise generic.ScriptError("Variable number must be a constant number", expr.pos)
if not (expr.param is None or isinstance(expr.param, expression.ConstantNumeric)):
raise generic.ScriptError("Variable parameter must be a constant number", expr.param.pos)
raise generic.ScriptError("Variable parameter must be a constant number", expr.pos)

if len(expr.extra_params) > 0:
first_var = len(self.var_list) == 0
Expand Down

0 comments on commit 60cb27d

Please sign in to comment.