]> granicus.if.org Git - yasm/commitdiff
Be less pedantic about trailing commas in data declarations and incbin.
authorPeter Johnson <peter@tortall.net>
Tue, 21 Oct 2003 01:54:31 +0000 (01:54 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 21 Oct 2003 01:54:31 +0000 (01:54 -0000)
We're still being pedantic when it comes to instructions, however.

Reported by: Edouard Gomez <ed.gomez@free.fr>

svn path=/trunk/yasm/; revision=1073

modules/parsers/nasm/nasm-bison.y
modules/parsers/nasm/tests/Makefile.inc
modules/parsers/nasm/tests/endcomma.asm [new file with mode: 0644]
modules/parsers/nasm/tests/endcomma.errwarn [new file with mode: 0644]
modules/parsers/nasm/tests/endcomma.hex [new file with mode: 0644]

index da3632d74388ed57bbbc2e08564f8d6f4a7f4fa3..abbe8fa33d23619b9ff120a3d0e5df0ab4947bd2 100644 (file)
@@ -172,9 +172,15 @@ exp: instr
     | INCBIN STRING                    {
        $$ = yasm_bc_create_incbin($2, NULL, NULL, cur_line);
     }
+    | INCBIN STRING ','                        {
+       $$ = yasm_bc_create_incbin($2, NULL, NULL, cur_line);
+    }
     | INCBIN STRING ',' expr           {
        $$ = yasm_bc_create_incbin($2, $4, NULL, cur_line);
     }
+    | INCBIN STRING ',' expr ','       {
+       $$ = yasm_bc_create_incbin($2, $4, NULL, cur_line);
+    }
     | INCBIN STRING ',' expr ',' expr  {
        $$ = yasm_bc_create_incbin($2, $4, $6, cur_line);
     }
@@ -208,6 +214,7 @@ datavals: dataval       {
        yasm_dvs_append(&$$, $1);
     }
     | datavals ',' dataval  { yasm_dvs_append(&$1, $3); $$ = $1; }
+    | datavals ','         { $$ = $1; }
 ;
 
 dataval: dvexpr                { $$ = yasm_dv_create_expr($1); }
index 18c250ac7aa91445834b1fe303c04b7faf877118..5fc8c92c0e548fe494411f63d91ae7f17d628d45 100644 (file)
@@ -3,6 +3,9 @@
 TESTS += modules/parsers/nasm/tests/nasm_test.sh
 
 EXTRA_DIST += modules/parsers/nasm/tests/nasm_test.sh
+EXTRA_DIST += modules/parsers/nasm/tests/endcomma.asm
+EXTRA_DIST += modules/parsers/nasm/tests/endcomma.errwarn
+EXTRA_DIST += modules/parsers/nasm/tests/endcomma.hex
 EXTRA_DIST += modules/parsers/nasm/tests/equlocal.asm
 EXTRA_DIST += modules/parsers/nasm/tests/equlocal.errwarn
 EXTRA_DIST += modules/parsers/nasm/tests/equlocal.hex
diff --git a/modules/parsers/nasm/tests/endcomma.asm b/modules/parsers/nasm/tests/endcomma.asm
new file mode 100644 (file)
index 0000000..8e09610
--- /dev/null
@@ -0,0 +1,2 @@
+[bits 32]
+db 1,2,3,4,
diff --git a/modules/parsers/nasm/tests/endcomma.errwarn b/modules/parsers/nasm/tests/endcomma.errwarn
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/modules/parsers/nasm/tests/endcomma.hex b/modules/parsers/nasm/tests/endcomma.hex
new file mode 100644 (file)
index 0000000..68d6ef9
--- /dev/null
@@ -0,0 +1,4 @@
+01 
+02 
+03 
+04