From a7a070371bcc10d0dbf94e503650856ac37ed81d Mon Sep 17 00:00:00 2001 From: Felix Perktold Date: Mon, 22 Dec 2025 00:14:15 +0100 Subject: add reading from files, add quote shorthand (') --- lisp.l | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp.l') 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; -- cgit v1.2.3