aboutsummaryrefslogtreecommitdiff
path: root/runner.py
diff options
context:
space:
mode:
authormryouse2022-05-10 04:12:04 +0000
committermryouse2022-05-10 04:12:04 +0000
commitdb5564306399f0a3af97eb13808140542aa5b42c (patch)
tree13aca4a0b54c63664e92c988a86975e30d77e95d /runner.py
parente2aff5eee62157d718e88628d9dd7e7a6aa19211 (diff)
nested expressions!
Diffstat (limited to 'runner.py')
-rw-r--r--runner.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/runner.py b/runner.py
index 8e4f86d..0d8560e 100644
--- a/runner.py
+++ b/runner.py
@@ -23,6 +23,12 @@ def evaluate(items, pop):
if not nxt.symbol.name in STD:
raise Exception(f"no such symbol: {nxt.symbol.name}")
this_func = STD[nxt.symbol.name]
+
+ # evaluate inner expressions
+ for idx, arg in enumerate(nxt.args):
+ if isinstance(arg, NebExpression):
+ nxt.args[idx] = evaluate([arg], pop)
+
if nxt.maybe_sig() not in this_func:
raise Exception(f"'{nxt.symbol.name}' called with unknown signature: '{nxt.maybe_sig()}'")
ret = this_func[nxt.maybe_sig()].impl(*(nxt.args))