Add README.md

This commit is contained in:
Bartłomiej Pluta
2019-09-06 16:49:43 +02:00
parent aa38e6b7b6
commit 231ce4c4c5
32 changed files with 2368 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ class ReturnEvaluator(Evaluator):
# Disclaimer
# Exception system usage to control program execution flow is really bad idea.
# However because of lack of 'goto' instruction equivalent in Python
# there is to need to use some mechanism to break function execution on 'return' statement
# there is a need to use some mechanism to break function execution on 'return' statement
# and immediately go to Environment's method 'invokeFunction()' or 'invokeMethod()',
# which can handle value that came with exception and return it to code being executed.
else:

View File

@@ -18,4 +18,4 @@ class PowerEvaluator(Evaluator):
if not right.type in supportedTypes:
raise RuntimeException(f"Operator '{node.operator.value}' is supported only by {[t.name.lower() for t in supportedTypes]} type", node.right.pos)
return Type.integer(int(left.value ** right.value))
return Type.float(float(left.value ** right.value))