emacs/test/lisp/progmodes/cperl-mode-resources/cperl-bug-64364.pl
Harald Jörg ce8e6cea42 cperl-mode.el: Support Perl 5.38 syntax for subroutine signatures
* lisp/progmodes/cperl-mode.el (defconst): New rx sequence
describing a signature with initialization.
(cperl-init-faces): integrate the new rx sequence into the
font-lock-defaults init routine (Bug#64190) (Bug#64364).

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-64364.pl: Add
test data for a signature with initialization (tests indentation).

* test/lisp/progmodes/cperl-mode-resources/proto-and-attrs.pl: Add
test data for a signature with initialization (tests fontification).
2023-07-01 21:40:46 +02:00

55 lines
838 B
Perl

# This resource file can be run with cperl--run-testcases from
# cperl-tests.el and works with both perl-mode and cperl-mode.
# -------- Bug#64364: input -------
package P {
sub way { ...; }
#
sub bus
:lvalue
($sig,$na,@ture)
{
...;
}
}
# -------- Bug#64364: expected output -------
package P {
sub way { ...; }
#
sub bus
:lvalue
($sig,$na,@ture)
{
...;
}
}
# -------- Bug#64364: end -------
# Now do this with multiline initializers
# -------- signature with init: input -------
package P {
sub way { ...; }
# perl 5.38 or newer
sub bus
:lvalue
($sig,
$na //= 42,
@ture)
{
...;
}
}
# -------- signature with init: expected output -------
package P {
sub way { ...; }
# perl 5.38 or newer
sub bus
:lvalue
($sig,
$na //= 42,
@ture)
{
...;
}
}
# -------- signature with init: end -------