aboutsummaryrefslogtreecommitdiff
path: root/boot/lexer.ll
diff options
context:
space:
mode:
Diffstat (limited to 'boot/lexer.ll')
-rw-r--r--boot/lexer.ll16
1 files changed, 14 insertions, 2 deletions
diff --git a/boot/lexer.ll b/boot/lexer.ll
index 4367caa..faae3d7 100644
--- a/boot/lexer.ll
+++ b/boot/lexer.ll
@@ -196,8 +196,20 @@ of {
return yy::parser::make_WORD(result, this->location);
}
}
-[[:digit:]]+\.[[:digit:]]+ {
- float result = strtof(yytext, NULL);
+[[:digit:]]+\.[[:digit:]]+([eE][+-]?[[:digit:]]+)? {
+ double result = strtod(yytext, NULL);
+
+ if (errno == ERANGE)
+ {
+ REJECT;
+ }
+ else
+ {
+ return yy::parser::make_FLOAT(result, this->location);
+ }
+}
+[[:digit:]]+[eE][+-]?[[:digit:]]+ {
+ double result = strtod(yytext, NULL);
if (errno == ERANGE)
{