diff options
| author | mryouse | 2022-05-10 04:12:04 +0000 |
|---|---|---|
| committer | mryouse | 2022-05-10 04:12:04 +0000 |
| commit | db5564306399f0a3af97eb13808140542aa5b42c (patch) | |
| tree | 13aca4a0b54c63664e92c988a86975e30d77e95d /runner.py | |
| parent | e2aff5eee62157d718e88628d9dd7e7a6aa19211 (diff) | |
nested expressions!
Diffstat (limited to 'runner.py')
| -rw-r--r-- | runner.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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)) |
