Properly detect time strings in the lexer without quotation marks.
Signed-off-by: Patrick McHardy <kaber@trash.net>
minutes = seconds / 60;
seconds %= 60;
- printf("\"");
-
if (days > 0)
printf("%"PRIu64"d", days);
if (hours > 0)
printf("%"PRIu64"m", minutes);
if (seconds > 0)
printf("%"PRIu64"s", seconds);
-
- printf("\"");
}
enum {
comment #.*$
slash \/
+timestring ([0-9]+d)?([0-9]+h)?([0-9]+m)?([0-9]+s)?
+
hex4 ([[:xdigit:]]{1,4})
v680 (({hex4}:){7}{hex4})
v670 ((:)((:{hex4}){7}))
return STRING;
}
+{timestring} {
+ yylval->string = xstrdup(yytext);
+ return STRING;
+ }
+
{decstring} {
errno = 0;
yylval->val = strtoull(yytext, NULL, 0);