Commit 2aca1998f6 for perl
commit 2aca1998f64dc7d40b99bb1faf5756ace5388f65
Author: Branislav Zahradník <barney@cpan.org>
Date: Sun Sep 27 14:17:23 2026 +0200
[perly] function invocation -> Unify logical name for function
Affected Perl expressions:
- `function { } ...`
- `&function`
- `&function ()`
- `function`
- `function ()`
- `function arguments`
Motivation:
Using a common name across multiple actions reduces the cognitive load
placed on the reader, maintainer, or reviewer.
diff --git a/perly.act b/perly.act
index ca2fb58fad..d3623c3b81 100644
--- a/perly.act
+++ b/perly.act
@@ -2407,6 +2407,6 @@ case 2: /* @1: %empty */
/* Generated from:
- * cbcd672850d1d32b4e4feded7a9fa38c273538bf99d2ad644b5387f2a8a42f6d perly.y
+ * 0ffe57437a5edd04421f66985e33aa2f62bf17372b5be5a372ac2d48c03ca2b5 perly.y
* ba173fe7f0e9b6b5465fb5d0705af3290ac7d8b511f0eead585307eb6c68918d regen_perly.pl
* ex: set ro ft=c: */
diff --git a/perly.h b/perly.h
index 2c2714534e..ad87094f92 100644
--- a/perly.h
+++ b/perly.h
@@ -248,6 +248,6 @@ int yyparse (void);
/* Generated from:
- * cbcd672850d1d32b4e4feded7a9fa38c273538bf99d2ad644b5387f2a8a42f6d perly.y
+ * 0ffe57437a5edd04421f66985e33aa2f62bf17372b5be5a372ac2d48c03ca2b5 perly.y
* ba173fe7f0e9b6b5465fb5d0705af3290ac7d8b511f0eead585307eb6c68918d regen_perly.pl
* ex: set ro ft=c: */
diff --git a/perly.tab b/perly.tab
index 563a9a2c39..ae3367b8b5 100644
--- a/perly.tab
+++ b/perly.tab
@@ -1667,6 +1667,6 @@ static const toketypes yy_type_tab[] =
};
/* Generated from:
- * cbcd672850d1d32b4e4feded7a9fa38c273538bf99d2ad644b5387f2a8a42f6d perly.y
+ * 0ffe57437a5edd04421f66985e33aa2f62bf17372b5be5a372ac2d48c03ca2b5 perly.y
* ba173fe7f0e9b6b5465fb5d0705af3290ac7d8b511f0eead585307eb6c68918d regen_perly.pl
* ex: set ro ft=c: */
diff --git a/perly.y b/perly.y
index 80f4d93943..8f3c39894c 100644
--- a/perly.y
+++ b/perly.y
@@ -1421,7 +1421,7 @@ listop : LSTOP indirob listexpr /* map {...} @args or print $fh @args */
| FUNC SUBLEXSTART optexpr SUBLEXEND /* uc($arg) from "\U..." */
{ $$ = op_convert_list($FUNC, 0, $optexpr); }
| /* sub f(&@); f { foo } ... */
- LSTOPSUB
+ LSTOPSUB [function]
startanonsub
block
{
@@ -1444,7 +1444,7 @@ listop : LSTOP indirob listexpr /* map {...} @args or print $fh @args */
$<opval>anonattrsub,
$optlistexpr
),
- $LSTOPSUB
+ $function
)
);
}
@@ -1739,27 +1739,27 @@ term[product] : termbinop
| THING %prec PERLY_PAREN_OPEN
{ $$ = $THING; }
| /* &foo; */
- amper
+ amper [function]
{
$$ = newUNOP (
OP_ENTERSUB,
0,
- scalar ($amper)
+ scalar ($function)
);
}
| /* &foo() or foo() */
- amper
+ amper [function]
PERLY_PAREN_OPEN
PERLY_PAREN_CLOSE
{
$$ = newUNOP (
OP_ENTERSUB,
OPf_STACKED,
- scalar ($amper)
+ scalar ($function)
);
}
| /* &foo(@args) or foo(@args) */
- amper
+ amper [function]
PERLY_PAREN_OPEN
expr
PERLY_PAREN_CLOSE
@@ -1770,13 +1770,13 @@ term[product] : termbinop
op_append_elem (
OP_LIST,
$expr,
- scalar ($amper)
+ scalar ($function)
)
);
}
| /* foo @args (no parens) */
NOAMP
- subname
+ subname [function]
optlistexpr
{
$$ = newUNOP (
@@ -1785,7 +1785,7 @@ term[product] : termbinop
op_append_elem (
OP_LIST,
$optlistexpr,
- scalar ($subname)
+ scalar ($function)
)
);
}
@@ -1817,16 +1817,16 @@ term[product] : termbinop
{ $$ = newOP(OP_REQUIRE, $KW_REQUIRE ? OPf_SPECIAL : 0); }
| KW_REQUIRE term[operand] /* require Foo */
{ $$ = newUNOP(OP_REQUIRE, $KW_REQUIRE ? OPf_SPECIAL : 0, $operand); }
- | UNIOPSUB
+ | UNIOPSUB [function]
{
$$ = newUNOP (
OP_ENTERSUB,
OPf_STACKED,
- scalar ($UNIOPSUB)
+ scalar ($function)
);
}
| /* Sub treated as unop */
- UNIOPSUB
+ UNIOPSUB [function]
term[operand]
{
$$ = newUNOP (
@@ -1835,7 +1835,7 @@ term[product] : termbinop
op_append_elem (
OP_LIST,
$operand,
- scalar ($UNIOPSUB)
+ scalar ($function)
)
);
}
@@ -1848,12 +1848,12 @@ term[product] : termbinop
| FUNC0OP PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
{ $$ = $FUNC0OP; }
| /* Sub treated as nullop */
- FUNC0SUB
+ FUNC0SUB [function]
{
$$ = newUNOP (
OP_ENTERSUB,
OPf_STACKED,
- scalar ($FUNC0SUB)
+ scalar ($function)
);
}
| FUNC1 PERLY_PAREN_OPEN PERLY_PAREN_CLOSE /* not () */