summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l14
1 files changed, 12 insertions, 2 deletions
diff --git a/parser.l b/parser.l
index c889d759..02cf2a8a 100644
--- a/parser.l
+++ b/parser.l
@@ -1234,8 +1234,18 @@ NJPUNC [^(){},:\[\]"~*^ \t\r\n]
return LITCHAR;
}
-<BUFLIT>{HEX} {
- yylval->chr = strtol(yytext, 0, 16);
+<BUFLIT>[0-9] {
+ yylval->chr = yytext[0] - '0';
+ return LITCHAR;
+}
+
+<BUFLIT>[A-F] {
+ yylval->chr = yytext[0] - 'A' + 10;
+ return LITCHAR;
+}
+
+<BUFLIT>[a-f] {
+ yylval->chr = yytext[0] - 'a' + 10;
return LITCHAR;
}