mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-10 14:10:51 +00:00

* 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).
55 lines
838 B
Perl
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 -------
|