aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-07-14 14:46:54 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-07-14 14:46:54 -0400
commitdb268547e272dada20d7404a25881bef50d3be8d (patch)
tree37e5ff8da8aefbc21ecac0792aa691c83869812b
parentcaecc4c8a174d136e66fafe6fa5d6b63285b2a1a (diff)
Add scientific notation for reals
-rw-r--r--pc.l11
1 files changed, 11 insertions, 0 deletions
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);