X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/95a1c52083ec4d3ba0727a0362422d8ac6192ba3..c708944da37fda4c2faf03aeddc9c9e5983ec407:/regen_perly.pl diff --git a/regen_perly.pl b/regen_perly.pl index ce69936..33cb3b7 100644 --- a/regen_perly.pl +++ b/regen_perly.pl @@ -187,6 +187,8 @@ foreach ($act_fh, $tab_fh, $h_fh) { exit 0; +# extract the tables and actions from the generated .c file + sub extract { my $clines = shift; my $tablines; @@ -207,23 +209,12 @@ sub extract { $tablines = $&; + # extract all the cases in the big action switch statement + $clines =~ m@ - switch \s* \( \s* \w+ \s* \) \s* { \s* - ( - case \s* \d+ \s* : - \s* - (?: \s* /\* .*? \*/ \s* )* # optional C-comments - \s* - \#line [^\n]+"\Q$y_file\E" - .*? - ) - } - \s* - (?: \s* /\* .*? \*/ \s* )* # optional C-comments - \s* - ( - YY_SYMBOL_PRINT - ) + switch \s* \( \s* yyn \s* \) \s* { \s* + ( .*? default: \s* break; \s* ) + } @xms or die "Can't extract actions from $tmpc_file\n"; $actlines = $1;