Improve error message related to usage variables starting with '_'

This commit is contained in:
Bartłomiej Pluta
2019-07-08 22:16:14 +02:00
parent 9186ea1b64
commit 38df0bf8df

View File

@@ -9,7 +9,7 @@ class AssignmentEvaluator(Evaluator):
def evaluator(cls, node, environment):
target = node.target.value
if target.startswith("_"):
raise RuntimeException("Usage of variables with names starting with '_' is not allowed", node.target.pos)
raise RuntimeException("Declaration and assignation variables with names starting with '_' is not allowed", node.target.pos)
value = expressionEvaluator(doAssert=True)(node.value, environment).value #TODO check if it isn't necessary to verify 'result' attr of EvaluatioNResult
scopeOfExistingVariable = environment.findVariableScope(target)