summaryrefslogtreecommitdiff
path: root/lisp.l
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-22 00:14:15 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-22 00:14:15 +0100
commita7a070371bcc10d0dbf94e503650856ac37ed81d (patch)
tree7b2e5968b623d15947bc0537a4ff64a385119f68 /lisp.l
parent33b3d80c2dcd12dbf692984e0d736bfa9906a8b5 (diff)
add reading from files, add quote shorthand (')
Diffstat (limited to 'lisp.l')
-rw-r--r--lisp.l9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp.l b/lisp.l
index 20b64af..fa2203a 100644
--- a/lisp.l
+++ b/lisp.l
@@ -9,9 +9,10 @@ int tcnt = 0;
%%
[[:space:]]+ { /* ignore whitespace */ }
";"[^\n]* { /* ignore comment */ }
-"(" { return LPAREN; }
-")" { return RPAREN; }
-"\." { return DOT; }
+"(" { return LPAREN; }
+")" { return RPAREN; }
+"\." { return DOT; }
+"'" { return QUOTE; }
[+-]?([0-9]+|([0-9]*\.[0-9]+))([eE][-+]?[0-9]+)? {
yylval.dval = atof(yytext);
@@ -32,7 +33,7 @@ int tcnt = 0;
return STRING;
}
-[^[:space:]\"().]+ {
+[^[:space:]\"()'.]+ {
yylval.strval = strdup(yytext);
return SYMBOL;