On Sunday 20 July 2008 18:19:05 James Keenan via RT wrote:

> 1 test still not passing as of r29636:
>
> not ok 36 - invalid label syntax # TODO RT#47978, RT#51104
>
> #   Failed (TODO) test 'invalid label syntax'
> #   at t/compilers/imcc/syn/macro.t line 469.
> #                   'compilers/imcc/imcc.l:1010: failed assertion 'valp->s'
> # Backtrace - Obtained 10 stack frames (max trace depth is 32).
> #   (unknown)
> #     Parrot_confess
> #       (unknown)
> #         yylex
> #           yyparse
> #             (unknown)
> #               imcc_run
> #                 (unknown)
> #                   __libc_start_main
> #                     (unknown)
> # '
> #     doesn't match '/syntax error(, unexpected LABEL)?/
> # '
> # './parrot
> "/home/jimk/work/parrot/t/compilers/imcc/syn/macro_36.pir"' failed with
> exit code [SIGNAL 6]

This patch isn't ideal, but it gets us closer (and avoiding SIGABRT is good).

-- c

--- t/compilers/imcc/syn/macro.t	(revision 29628)
+++ t/compilers/imcc/syn/macro.t	(working copy)
@@ -466,7 +466,7 @@
 CODE
 OUTPUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', 'invalid label syntax', todo => 'RT#47978, RT#51104');
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'invalid label syntax');
 .sub test :main
     .macro m()
         .local $iter_loop:
@@ -476,7 +476,7 @@
     .m()
 .end
 CODE
-/syntax error(, unexpected LABEL)?/
+/Syntax error in macro at: \('\$iter_loop:'\)/
 OUTPUT
 
 pir_output_is( <<'CODE', <<'OUTPUT', 'call a sub in a macro' );
Index: compilers/imcc/imcc.l
===================================================================
--- compilers/imcc/imcc.l	(revision 29628)
+++ compilers/imcc/imcc.l	(working copy)
@@ -1005,7 +1005,11 @@
                         "File ended before macro '%s' was complete",
                         IMCC_INFO(interp)->cur_macro_name);
 
-        PARROT_ASSERT(valp->s);
+        if (!valp->s) {
+            yyerror(yyscanner, interp, "Syntax error in macro at:");
+            exit(1);
+        }
+
         elem_len = strlen(valp->s);
 
         if (buffer_used) {

Reply via email to