Add README.md
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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))
|
||||
Reference in New Issue
Block a user