From a0a91d6c786c2b155b015d6819856ae36914ed29 Mon Sep 17 00:00:00 2001 From: Filleo Date: Mon, 22 Apr 2024 11:11:02 +0200 Subject: [PATCH] added numbers to Ident token --- src/lex/lexer.l | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lex/lexer.l b/src/lex/lexer.l index 359ac96..49ff6cc 100644 --- a/src/lex/lexer.l +++ b/src/lex/lexer.l @@ -76,10 +76,11 @@ "lineno" {DEBUG("\"%s\" tokenized with \'FunLineno\'", yytext); return(FunLineno);}; "extsupport" {DEBUG("\"%s\" tokenized with \'FunExtsupport\'", yytext); return(FunExtsupport);}; -[a-zA-Z_]+ {DEBUG("\"%s\" tokenized with \'Ident\'", yytext); yylval.string = strdup(yytext); return(Ident); }; + [0-9]+ {DEBUG("\"%s\" tokenized with \'ValInt\'", yytext); yylval.string = strdup(yytext); return(ValInt); }; +[0-9]*\.[0-9]+ {DEBUG("\"%s\" tokenized with \'ValFloat\'", yytext); yylval.string = strdup(yytext); return(ValFloat);}; +[a-zA-Z_0-9]+ {DEBUG("\"%s\" tokenized with \'Ident\'", yytext); yylval.string = strdup(yytext); return(Ident); }; \"([^\"\n])*\" {DEBUG("\"%s\" tokenized with \'ValStr\'", yytext); yylval.string = strdup(yytext); return(ValStr);}; \"\"\"([^\"\n]|\\\n)*\"\"\" {DEBUG("\"%s\" tokenized with \'ValMultistr\'", yytext); yylval.string = strdup(yytext); return(ValMultistr);}; -[0-9]*\.[0-9]+ {DEBUG("\"%s\" tokenized with \'ValFloat\'", yytext); yylval.string = strdup(yytext); return(ValFloat);}; .; %%