mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 16:39:36 +00:00
[parser] Decompose barestmt -> bare_statement_block
This commit is contained in:
parent
6e421d713c
commit
825f28de1e
2
perly.h
generated
2
perly.h
generated
@ -246,6 +246,6 @@ int yyparse (void);
|
||||
|
||||
|
||||
/* Generated from:
|
||||
* 71250ac38c6eebb488e0a004d8fb76837034212b42fd84e5757a75bd179672fb perly.y
|
||||
* e337cd6688d376b8a6e00ef76318ac740fdb3c9ebe57f2536198d92da4ee51df perly.y
|
||||
* f13e9c08cea6302f0c1d1f467405bd0e0880d0ea92d0669901017a7f7e94ab28 regen_perly.pl
|
||||
* ex: set ro ft=c: */
|
||||
|
||||
19
perly.y
19
perly.y
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user