diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2006-12-10 17:18:00 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2006-12-10 17:18:00 +0000 |
commit | d5c6462ec54f07680e7532435b71727ae3075024 (patch) | |
tree | 9313e705118463248715dffd61f1a841d4fcc069 /perly.c | |
parent | 88517a295e2cbde1046f3c95e6e78054c21985fa (diff) | |
download | perl-d5c6462ec54f07680e7532435b71727ae3075024.tar.gz |
parser: expand yy_is_opval[] to include all value types
and rename to yy_type_tab[]. Then use this table to improve stack
dumping with -Dpv
p4raw-id: //depot/perl@29500
Diffstat (limited to 'perly.c')
-rw-r--r-- | perly.c | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -157,15 +157,28 @@ yy_stack_print (pTHX_ const short *yyss, const short *yyssp, const YYSTYPE *yyvs PerlIO_printf(Perl_debug_log, " %8.8s", yyns[start+i]); PerlIO_printf(Perl_debug_log, "\nvalue:"); for (i=0; i < count; i++) { - if (yy_is_opval[yystos[yyss[start+i]]]) { + switch (yy_type_tab[yystos[yyss[start+i]]]) { + case toketype_opval: PerlIO_printf(Perl_debug_log, " %8.8s", yyvs[start+i].opval ? PL_op_name[yyvs[start+i].opval->op_type] - : "NULL" + : "(NULL)" ); - } - else + break; +#ifndef PERL_IN_MADLY_C + case toketype_p_tkval: + PerlIO_printf(Perl_debug_log, " %8.8s", + yyvs[start+i].pval ? yyvs[start+i].pval : "(NULL)"); + break; + + case toketype_i_tkval: +#endif + case toketype_ival: + PerlIO_printf(Perl_debug_log, " %8"IVdf, yyvs[start+i].ival); + break; + default: PerlIO_printf(Perl_debug_log, " %8"UVxf, (UV)yyvs[start+i].ival); + } } PerlIO_printf(Perl_debug_log, "\n\n"); } @@ -658,7 +671,7 @@ Perl_yyparse (pTHX) /* Pop the rest of the stack. */ while (yyss < yyssp) { YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp); - if (yy_is_opval[yystos[*yyssp]]) { + if (yy_type_tab[yystos[*yyssp]] == toketype_opval) { YYDPRINTF ((Perl_debug_log, "(freeing op)\n")); op_free(yyvsp->opval); } @@ -699,7 +712,7 @@ Perl_yyparse (pTHX) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp); - if (yy_is_opval[yystos[*yyssp]]) { + if (yy_type_tab[yystos[*yyssp]] == toketype_opval) { YYDPRINTF ((Perl_debug_log, "(freeing op)\n")); op_free(yyvsp->opval); } |