summaryrefslogtreecommitdiff
path: root/lisp.y
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-20 22:43:37 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-20 22:43:37 +0100
commit6506e5c3d24f01b3a662a58884e210f4c9e023b8 (patch)
tree00cd6c02a9eefb12890f88f1c5b20fd8d2b7c9a4 /lisp.y
parentdc0074b1accf92ce2e1fa126dccf702722f11611 (diff)
cleanup
Diffstat (limited to 'lisp.y')
-rw-r--r--lisp.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp.y b/lisp.y
index 29031a4..c2ca8f5 100644
--- a/lisp.y
+++ b/lisp.y
@@ -23,7 +23,7 @@ static int is_integer(double x) {
%token <ival> LPAREN RPAREN DOT WHITESPACE
%token <ival> PLUS MINUS MULT DIV
-%type <val> sexpr atom sexprs
+%type <val> sexpr atom
%start sexprs
@@ -31,8 +31,8 @@ static int is_integer(double x) {
opt_ws: /* matches no whitespace */
| WHITESPACE;
-sexprs: sexpr
- | sexprs opt_ws sexpr;
+sexprs: sexpr { print_val($1); printf("\n"); }
+ | sexprs opt_ws sexpr { print_val($3); };
sexpr: atom
| LPAREN opt_ws sexpr opt_ws DOT opt_ws sexpr opt_ws RPAREN