This token combines decstring and hexstring. The latter two had
identical action blocks (which were not completely trivial), this allows
to merge them.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
hexdigit [0-9a-fA-F]
decstring {digit}+
hexstring 0[xX]{hexdigit}+
+numberstring ({decstring}|{hexstring})
letter [a-zA-Z]
string ({letter}|[_.])({letter}|{digit}|[/\-_\.])*
quotedstring \"[^"]*\"
return STRING;
}
-{decstring} {
- errno = 0;
- yylval->val = strtoull(yytext, NULL, 0);
- if (errno != 0) {
- yylval->string = xstrdup(yytext);
- return STRING;
- }
- return NUM;
- }
-
-{hexstring} {
+{numberstring} {
errno = 0;
yylval->val = strtoull(yytext, NULL, 0);
if (errno != 0) {