summaryrefslogtreecommitdiffstats
path: root/src/scanner.l
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2015-01-11 23:59:10 +0000
committerPatrick McHardy <kaber@trash.net>2015-01-11 23:59:10 +0000
commit69a54250650b9566470e62f39296ecb2b5010f84 (patch)
treeee80944c766fee8182084ae395989095d81f6673 /src/scanner.l
parentb17e27f472adc2e82582d90df0111d5b95c8afe0 (diff)
parser: properly fix handling of large integer values
Introduction of the ERROR symbol is an ugly hack. There's no reason to special case large integer values, the NUM token only exists for small values that are needed immediately, everything else is passed as EXPR_SYMBOL to evaluation anyways. Additionally the error reporting is different from what we'd usually report, the token is easy to confuse with the bison internal error token and it even has a name, messing up bison internal diagnostics. Simply return values to large to be handled by strtoull as STRING. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/scanner.l')
-rw-r--r--src/scanner.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scanner.l b/src/scanner.l
index 52b00783..73c4f8b1 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -462,7 +462,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
yylval->val = strtoull(yytext, NULL, 0);
if (errno != 0) {
yylval->string = xstrdup(yytext);
- return ERROR;
+ return STRING;
}
return NUM;
}
@@ -472,7 +472,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
yylval->val = strtoull(yytext, NULL, 0);
if (errno != 0) {
yylval->string = xstrdup(yytext);
- return ERROR;
+ return STRING;
}
return NUM;
}