]> granicus.if.org Git - yasm/commitdiff
Fix hexidecimal number handling. It was only allowing numbers starting with 0.
authorPeter Johnson <peter@tortall.net>
Mon, 19 Nov 2001 05:23:00 +0000 (05:23 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 19 Nov 2001 05:23:00 +0000 (05:23 -0000)
svn path=/trunk/yasm/; revision=347

modules/parsers/nasm/token.l.in
src/parsers/nasm/token.l.in

index a24da44ebb21f80c1541400b3325adf358baf90b..a3b086e1fae535f409f73f2635ffac328f0c0b74 100644 (file)
@@ -100,14 +100,14 @@ WS       [ \t\r]
 }
 
     /* 0AAh form of hexidecimal number */
-0{HEXDIGIT}+h {
+{DIGIT}{HEXDIGIT}+h {
     yytext[strlen(yytext)-1] = '\0';  /* strip off 'h' */
     yylval.intn = intnum_new_hex(yytext);
     return INTNUM;
 }
 
     /* $0AA and 0xAA forms of hexidecimal number */
-(\$0|0x){HEXDIGIT}+ {
+(\${DIGIT}|0x){HEXDIGIT}+ {
     if (yytext[1] == 'x')
        yylval.intn = intnum_new_hex(yytext+2); /* 0x format, skip 0 and x */
     else
index a24da44ebb21f80c1541400b3325adf358baf90b..a3b086e1fae535f409f73f2635ffac328f0c0b74 100644 (file)
@@ -100,14 +100,14 @@ WS       [ \t\r]
 }
 
     /* 0AAh form of hexidecimal number */
-0{HEXDIGIT}+h {
+{DIGIT}{HEXDIGIT}+h {
     yytext[strlen(yytext)-1] = '\0';  /* strip off 'h' */
     yylval.intn = intnum_new_hex(yytext);
     return INTNUM;
 }
 
     /* $0AA and 0xAA forms of hexidecimal number */
-(\$0|0x){HEXDIGIT}+ {
+(\${DIGIT}|0x){HEXDIGIT}+ {
     if (yytext[1] == 'x')
        yylval.intn = intnum_new_hex(yytext+2); /* 0x format, skip 0 and x */
     else