From db268547e272dada20d7404a25881bef50d3be8d Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 14 Jul 2019 14:46:54 -0400 Subject: Add scientific notation for reals --- pc.l | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pc.l b/pc.l index 15c6691..e744c4d 100644 --- a/pc.l +++ b/pc.l @@ -203,6 +203,17 @@ id [A-Za-z][A-Za-z0-9_]* return RNUM; } +{number}[eE][+-]?{number} { + yylval.rval = atof(yytext); + debug_print(RNUM, &yylval); + return RNUM; +} +{number}.{number}[eE][+-]?{number} { + yylval.rval = atof(yytext); + debug_print(RNUM, &yylval); + return RNUM; +} + {id} { yylval.sval = strdup(yytext); debug_print(ID, &yylval); -- cgit v1.1