[parser] Decompose barestmt -> bare_statement_block

This commit is contained in:
Branislav Zahradník 2025-10-01 14:36:18 +02:00 committed by Lukas Mai
parent 6e421d713c
commit 825f28de1e
4 changed files with 1728 additions and 1727 deletions

1323
perly.act generated

File diff suppressed because it is too large Load Diff

2
perly.h generated
View File

@ -246,6 +246,6 @@ int yyparse (void);
/* Generated from:
* 71250ac38c6eebb488e0a004d8fb76837034212b42fd84e5757a75bd179672fb perly.y
* e337cd6688d376b8a6e00ef76318ac740fdb3c9ebe57f2536198d92da4ee51df perly.y
* f13e9c08cea6302f0c1d1f467405bd0e0880d0ea92d0669901017a7f7e94ab28 regen_perly.pl
* ex: set ro ft=c: */

2111
perly.tab generated

File diff suppressed because it is too large Load Diff

19
perly.y
View File

@ -94,6 +94,9 @@
%token <ival> PHASER
%type <ival> grammar remember mremember
%type <opval> bare_statement_block
%type <ival> startsub startanonsub startanonmethod startformsub
%type <ival> mintro
@ -239,6 +242,15 @@ grammar : GRAMPROG
}
;
bare_statement_block
: block
cont
{
/* a block is a loop that happens once */
$$ = newWHILEOP(0, 1, NULL, NULL, $block, $cont, 0);
}
;
/* Either a signatured 'sub' or 'method' keyword */
sigsub_or_method_named
: KW_SUB_named_sig
@ -352,6 +364,7 @@ labfullstmt: LABEL barestmt
*/
barestmt
: PLUGSTMT
| bare_statement_block
| KW_FORMAT startformsub formname formblock
{
CV *fmtcv = PL_compcv;
@ -587,12 +600,6 @@ barestmt
$$ = op_wrap_finally($$, $finally);
parser->copline = (line_t)$KW_TRY;
}
| block cont
{
/* a block is a loop that happens once */
$$ = newWHILEOP(0, 1, NULL,
NULL, $block, $cont, 0);
}
| KW_PACKAGE BAREWORD[version] BAREWORD[package] PERLY_BRACE_OPEN remember
{
package($package);