; cperl-mode-resources: More test cases for cperl-mode.el
* test/lisp/progmodes/cperl-mode-resources/proto-and-attrs.pl: Adapt to the signatures now available in cperl-mode.el
This commit is contained in:
parent
a7ff8a76a5
commit
76182f4b93
1 changed files with 11 additions and 7 deletions
|
@ -12,12 +12,10 @@
|
|||
# are somewhat frowned upon most of the times, but they are required
|
||||
# for some Perl magic
|
||||
|
||||
# FIXME: 2022-02-02 CPerl mode does not handle subroutine signatures.
|
||||
# In simple cases it mistakes them as prototypes, when attributes are
|
||||
# present, it doesn't handle them at all. Variables in signatures
|
||||
# SHOULD be fontified like variable declarations.
|
||||
|
||||
# Part 1: Named subroutines
|
||||
# A plain named subroutine without any optional stuff
|
||||
sub sub_0 { ...; }
|
||||
|
||||
# A prototype and a trivial subroutine attribute
|
||||
{
|
||||
no feature 'signatures'; # that's a prototype, not a signature
|
||||
|
@ -30,10 +28,16 @@
|
|||
# A signature (these will soon-ish leave the experimental state)
|
||||
sub sub_3 ($foo,$bar) { ...; }
|
||||
|
||||
# Attribute plus signature FIXME: Not yet supported
|
||||
sub bad_sub_4 :prototype($$$) ($foo,$bar,$baz) { ...; }
|
||||
# Attribute plus signature
|
||||
sub sub_4 :prototype($$$) ($foo,$bar,$baz) { ...; }
|
||||
|
||||
# A signature with a trailing comma (weird, but legal)
|
||||
sub sub_5 ($foo,$bar,) { ...; }
|
||||
|
||||
# Part 2: Same constructs for anonymous subs
|
||||
# A plain named subroutine without any optional stuff
|
||||
my $subref_0 = sub { ...; }
|
||||
|
||||
# A prototype and a trivial subroutine attribute
|
||||
{
|
||||
no feature 'signatures'; # that's a prototype, not a signature
|
||||
|
|
Loading…
Add table
Reference in a new issue