mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-12 15:10:50 +00:00

* lisp/progmodes/cperl-mode.el (cperl-sniff-for-indent): Detect whether we have a label or a regex/string. (cperl-calculate-indent): Check for things which look like labels but aren't. * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-11733): Test the examples provided in the bug report. * test/lisp/progmodes/cperl-mode-resources/cperl-bug-11733.pl: Examples from the bug report.
50 lines
788 B
Perl
50 lines
788 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.
|
|
|
|
# -------- Multiline declaration: input -------
|
|
#!/usr/bin/env perl
|
|
# -*- mode: cperl -*-
|
|
|
|
sub foo
|
|
{
|
|
}
|
|
|
|
sub bar
|
|
{
|
|
}
|
|
# -------- Multiline declaration: expected output -------
|
|
#!/usr/bin/env perl
|
|
# -*- mode: cperl -*-
|
|
|
|
sub foo
|
|
{
|
|
}
|
|
|
|
sub bar
|
|
{
|
|
}
|
|
# -------- Multiline declaration: end -------
|
|
|
|
# -------- Fred Colon at work: input --------
|
|
#!/usr/bin/env perl
|
|
# -*- mode: cperl -*-
|
|
|
|
while (<>)
|
|
{
|
|
m:^ \d+ p:
|
|
or die;
|
|
m:^ \d+ :
|
|
or die;
|
|
}
|
|
# -------- Fred Colon at work: expected output --------
|
|
#!/usr/bin/env perl
|
|
# -*- mode: cperl -*-
|
|
|
|
while (<>)
|
|
{
|
|
m:^ \d+ p:
|
|
or die;
|
|
m:^ \d+ :
|
|
or die;
|
|
}
|
|
# -------- Fred Colon at work: end --------
|