diff options
| author | Felix Perktold <Felix.Perktold@student.uibk.ac.at> | 2025-12-21 14:01:36 +0100 |
|---|---|---|
| committer | Felix Perktold <Felix.Perktold@student.uibk.ac.at> | 2025-12-21 14:01:36 +0100 |
| commit | 4f025b96cfe6bc121ea9b37eb26d8814dd838647 (patch) | |
| tree | 50a034fe08d59d52a6c90fee19d1179a76736221 /lisp.y | |
| parent | e3b757ab811e82f8e1022b0bba0be5f3c328f8b7 (diff) | |
start implementing eval
Diffstat (limited to 'lisp.y')
| -rw-r--r-- | lisp.y | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -28,8 +28,14 @@ static int is_integer(double x) { %start sexprs %% -sexprs: sexpr { print_value($1); printf("\n"); } - | sexprs sexpr { print_value($2); printf("\n"); }; +sexprs: sexpr + { + print_value(eval(global_env, $1)); printf("\n"); + } + | sexprs sexpr + { + print_value(eval(global_env, $2)); printf("\n"); + }; sexpr: atom | list |
