mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-10 00:00:39 -08:00
Since Perl 5.20, subroutine signatures were available as an experimental feature. With Perl 5.38, they will be always enabled in the new object system. * test/lisp/progmodes/cperl-mode-resources/cperl-bug-64190.pl: * test/lisp/progmodes/cperl-mode-resources/cperl-bug-64364.pl: New test resources. * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-fontify-attrs-and-signatures): Add tests for signatures. (cperl-test-attribute-rx, cperl-test-attribute-list-rx) (cperl-test-prototype-rx, cperl-test-signature-rx): Tests for the new rx sequences. (cperl-test-bug-64190): New test for multiline declarations. (cperl-test-bug-64364): New test for indentation of declarations. * lisp/progmodes/cperl-mode.el: (toplevel): New rx sequences to match Perl variables and attributes. (cperl-declaration-header-p): New function to identify declarations. (cperl-block-declaration-p): Use the new function. (cperl-mode): Use the rx sequences. (cperl-get-state): Use the new function. (cperl-sniff-for-indent): Use the new function. (cperl-find-sub-attrs): Improve fontification of subroutine prototypes and attributes while typing when jit-lock-mode is active. Detect signatures, and distinguish them from prototypes. (cperl-find-pods-heres): Use the rx sequences to detect subroutines. (cperl-init-faces): Use the rx sequences for fontification.
26 lines
416 B
Perl
26 lines
416 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 -------
|