[parser] Decompose barestmt -> bare_statement_field_declaration

This commit is contained in:
Branislav Zahradník 2025-10-01 20:56:58 +02:00 committed by Lukas Mai
parent 6111a9cae2
commit d666e956c8
4 changed files with 1368 additions and 1355 deletions

1246
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:
* 9cf67d3e3259a09eafe76d231b0b9f7d4e2e5d3dcf7afc2109cb5432ac6af0f5 perly.y
* e71d4518027b39f91c89342141cd1ac5b2f72da5a9e3dc004e2f15a408c7ed65 perly.y
* f13e9c08cea6302f0c1d1f467405bd0e0880d0ea92d0669901017a7f7e94ab28 regen_perly.pl
* ex: set ro ft=c: */

1461
perly.tab generated

File diff suppressed because it is too large Load Diff

14
perly.y
View File

@ -101,6 +101,7 @@
%type <opval> bare_statement_default
%type <opval> bare_statement_defer
%type <opval> bare_statement_expression
%type <opval> bare_statement_field_declaration
%type <ival> startsub startanonsub startanonmethod startformsub
@ -325,6 +326,14 @@ bare_statement_expression
}
;
bare_statement_field_declaration
: fielddecl
PERLY_SEMICOLON
{
$$ = $fielddecl;
}
;
/* Either a signatured 'sub' or 'method' keyword */
sigsub_or_method_named
: KW_SUB_named_sig
@ -444,6 +453,7 @@ barestmt
| bare_statement_default
| bare_statement_defer
| bare_statement_expression
| bare_statement_field_declaration
| KW_FORMAT startformsub formname formblock
{
CV *fmtcv = PL_compcv;
@ -681,10 +691,6 @@ barestmt
if (parser->copline > (line_t)$PERLY_BRACE_OPEN)
parser->copline = (line_t)$PERLY_BRACE_OPEN;
}
| fielddecl PERLY_SEMICOLON
{
$$ = $fielddecl;
}
| YADAYADA PERLY_SEMICOLON
{
/* diag_listed_as: Unimplemented */