summaryrefslogtreecommitdiff
path: root/lisp.l
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-21 00:35:10 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-21 00:35:10 +0100
commitbb631d0e744fa91c663a7a35195125e36c1139b0 (patch)
tree6bee67244cbbbbe5251dcb5aae64e12ee2b190c4 /lisp.l
parent41d98bd3fde6fdc4d1550108f8528f8dfcc97206 (diff)
remove WHITESPACE token, ignore whitespace in lexer
Diffstat (limited to 'lisp.l')
-rw-r--r--lisp.l4
1 files changed, 2 insertions, 2 deletions
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;