From 6506e5c3d24f01b3a662a58884e210f4c9e023b8 Mon Sep 17 00:00:00 2001 From: Felix Perktold Date: Sat, 20 Dec 2025 22:43:37 +0100 Subject: cleanup --- lisp.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp.y') 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 LPAREN RPAREN DOT WHITESPACE %token PLUS MINUS MULT DIV -%type sexpr atom sexprs +%type 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 -- cgit v1.2.3