mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 22:41:06 -08:00
* lisp/progmodes/cperl-mode.el (cperl-after-block-and-statement-beg): Recognize _ as part of a Perl symbol. Fixes Bug#76851 * test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts Two new test cases around the edges of Bug#76851
100 lines
998 B
Text
100 lines
998 B
Text
Code:
|
|
(lambda ()
|
|
(cperl-mode)
|
|
(indent-region (point-min) (point-max)))
|
|
|
|
Name: cperl-indent1
|
|
|
|
=-=
|
|
{
|
|
print "",
|
|
"",
|
|
foo::bar(),
|
|
"";
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-indents1
|
|
|
|
=-=
|
|
{
|
|
print "",
|
|
"",
|
|
foobar(),
|
|
"";
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-try-catch-finally
|
|
|
|
=-=
|
|
{
|
|
try {
|
|
call_a_function();
|
|
}
|
|
catch ($e) {
|
|
warn "Unable to call; $e";
|
|
}
|
|
finally {
|
|
print "Finished\n";
|
|
}
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-defer
|
|
|
|
=-=
|
|
use feature 'defer';
|
|
|
|
{
|
|
say "This happens first";
|
|
defer {
|
|
say "This happens last";
|
|
}
|
|
|
|
say "And this happens inbetween";
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-feature-class
|
|
|
|
=-=
|
|
use 5.038;
|
|
use feature "class";
|
|
no warnings "experimental";
|
|
|
|
class A {
|
|
}
|
|
|
|
class C
|
|
: isa(A)
|
|
{
|
|
method with_sig_and_attr
|
|
: lvalue
|
|
($top,$down)
|
|
{
|
|
return $top-$down;
|
|
}
|
|
}
|
|
|
|
say "done!";
|
|
=-=-=
|
|
|
|
Name: cperl-keyword-in-subname
|
|
|
|
=-=
|
|
# Bug#76851
|
|
sub exec_fcn {
|
|
}
|
|
|
|
sub other {
|
|
}
|
|
=-=-=
|
|
|
|
Name: cperl-keyword-without-space
|
|
|
|
=-=
|
|
# Bug#76851, message #13
|
|
my %h = map{$_=>1}
|
|
@ARGV;
|
|
=-=-=
|