From bb631d0e744fa91c663a7a35195125e36c1139b0 Mon Sep 17 00:00:00 2001 From: Felix Perktold Date: Sun, 21 Dec 2025 00:35:10 +0100 Subject: remove WHITESPACE token, ignore whitespace in lexer --- lisp.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp.l') diff --git a/lisp.l b/lisp.l index bbeb02d..7a9eece 100644 --- a/lisp.l +++ b/lisp.l @@ -7,7 +7,7 @@ int tcnt = 0; %} %% -[[:space:]]+ { printf("%d: WHITESPACE\n", ++tcnt); return WHITESPACE; } +[[:space:]]+ { printf("%d: WHITESPACE\n", tcnt); /*ignore whitespace*/} "(" { printf("%d: LPAREN\n", ++tcnt); return LPAREN; } ")" { printf("%d: RPAREN\n", ++tcnt); return RPAREN; } "\." { printf("%d: DOT\n", ++tcnt); return DOT; } @@ -31,7 +31,7 @@ int tcnt = 0; return STRING; } -[^[:space:]\"()]+ { +[^[:space:]\"().]+ { yylval.strval = strdup(yytext); printf("%d: SYMBOL: %s\n", ++tcnt, yylval.strval); return SYMBOL; -- cgit v1.2.3