From dd9385b404c28a155a91960a4f1c4c77fdc5413d Mon Sep 17 00:00:00 2001 From: Harald Jörg Date: Wed, 9 Jun 2021 22:58:53 +0200 Subject: ; perl-mode.el: Detect quote-like operator immediately after => * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Detect a quotelike operator immediately after a fat comma "=>" (Bug#25098) * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-25098): Test case for the bug with code from the bug report. * test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl: Resource file for the test. --- .../cperl-mode-resources/cperl-bug-25098.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl (limited to 'test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl') diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl new file mode 100644 index 00000000000..0987b4e02c0 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl @@ -0,0 +1,21 @@ +# Code from the bug report Bug#25098 + +my $good = XML::LibXML->load_xml( string => q{
}); +my $bad = XML::LibXML->load_xml( string =>q{
}); + +# Related: Method calls are no quotelike operators. That's why you +# can't just add '>' to the character class. + +my $method_call = $object->q(argument); + +# Also related, still not fontified correctly: +# +# my $method_call = $object -> q (argument); +# +# perl-mode interprets the method call as a quotelike op (because it +# is preceded by a space). +# cperl-mode gets the argument right, but marks q as a quotelike op. +# +# my $greater = 2>q/1/; +# +# perl-mode doesn't identify this as a quotelike op. -- cgit v1.2.3