Create evaluator for power operator

This commit is contained in:
Bartłomiej Pluta
2019-07-12 19:54:29 +02:00
parent 35eb38076f
commit 65fccda989
4 changed files with 27 additions and 7 deletions

View File

@@ -11,6 +11,6 @@ class NotEvaluator(Evaluator):
value = expressionEvaluator(doAssert=True)(node.value, environment).value
if value.type != Type.BOOL:
raise RuntimeException(f"Operator '{node.operator.value}' is supported only by {Type.BOOL.name.lower()} type", node.pos)
raise RuntimeException(f"Operator '{node.operator.value}' is supported only by {Type.BOOL.name.lower()} type", node.value.pos)
return Type.bool(not value.value)