diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-07-14 14:46:54 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-07-14 14:46:54 -0400 |
commit | db268547e272dada20d7404a25881bef50d3be8d (patch) | |
tree | 37e5ff8da8aefbc21ecac0792aa691c83869812b | |
parent | caecc4c8a174d136e66fafe6fa5d6b63285b2a1a (diff) |
Add scientific notation for reals
-rw-r--r-- | pc.l | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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); |