]> granicus.if.org Git - yasm/commitdiff
Fix #127: Allow use of 0X in addition to 0x for hex constants.
authorPeter Johnson <peter@tortall.net>
Tue, 4 Dec 2007 04:59:07 +0000 (04:59 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 4 Dec 2007 04:59:07 +0000 (04:59 -0000)
svn path=/trunk/yasm/; revision=2017

modules/parsers/nasm/nasm-token.re
modules/parsers/nasm/tests/Makefile.inc
modules/parsers/nasm/tests/hexconst.asm [new file with mode: 0644]
modules/parsers/nasm/tests/hexconst.hex [new file with mode: 0644]

index cbf9fb0f7408ca5c1611fe074c4de97cdee7e69e..8d385e50d2e2e430bde31a7d8e5c8c5280b005bd 100644 (file)
@@ -144,10 +144,10 @@ scan:
         }
 
         /* $0AA and 0xAA forms of hexidecimal number */
-        (("$" digit) | "0x") hexdigit+ {
+        (("$" digit) | '0x') hexdigit+ {
             savech = s->tok[TOKLEN];
             s->tok[TOKLEN] = '\0';
-            if (s->tok[1] == 'x')
+            if (s->tok[1] == 'x' || s->tok[1] == 'X')
                 /* skip 0 and x */
                 lvalp->intn = yasm_intnum_create_hex(TOK+2);
             else
index 552320cc94cc2755457d8d22ddbd10823f79272e..8ec457b47d87ecb3d41912a0c20cd84a0eb03fe8 100644 (file)
@@ -15,6 +15,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/equcolon.asm
 EXTRA_DIST += modules/parsers/nasm/tests/equcolon.hex
 EXTRA_DIST += modules/parsers/nasm/tests/equlocal.asm
 EXTRA_DIST += modules/parsers/nasm/tests/equlocal.hex
+EXTRA_DIST += modules/parsers/nasm/tests/hexconst.asm
+EXTRA_DIST += modules/parsers/nasm/tests/hexconst.hex
 EXTRA_DIST += modules/parsers/nasm/tests/long.asm
 EXTRA_DIST += modules/parsers/nasm/tests/long.hex
 EXTRA_DIST += modules/parsers/nasm/tests/newsect.asm
diff --git a/modules/parsers/nasm/tests/hexconst.asm b/modules/parsers/nasm/tests/hexconst.asm
new file mode 100644 (file)
index 0000000..a0039b0
--- /dev/null
@@ -0,0 +1,2 @@
+dd 0x500
+dd 0X500
diff --git a/modules/parsers/nasm/tests/hexconst.hex b/modules/parsers/nasm/tests/hexconst.hex
new file mode 100644 (file)
index 0000000..90a00fe
--- /dev/null
@@ -0,0 +1,8 @@
+00 
+05 
+00 
+00 
+00 
+05 
+00 
+00