1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-19 12:20:17 -08:00
emacs/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl
Harald Jörg fb26dc130d cperl-mode: Delete a misleading comment, add tests for verification
* lisp/progmodes/cperl-mode.el: Delete a comment which explains a
bug which has been fixed a long time ago (bug#44073).
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-fontify-punct-vars): Add regression tests to verify
that fontification of punctuation variables doesn't start strings.
2020-10-19 10:57:57 +02:00

20 lines
1 KiB
Perl

# The following Perl punctiation variables contain characters which
# are classified as string delimiters in the syntax table. The mode
# should not be confused by these.
# The corresponding tests check that two consecutive '#' characters
# are seen as comments, not as strings.
my $pre = $`; ## $PREMATCH, use another ` # to balance out
my $pos = $'; ## $POSTMATCH, use another ' # to balance out
my $lsp = $"; ## $LIST_SEPARATOR use another " # to balance out
# In the second level, we use the reference constructor \ on these
# variables. The backslash is an escape character *only* in strings.
my $ref = \$`; ## \$PREMATCH, use another ` # to balance out
my $rif = \$'; ## \$POSTMATCH, use another ' # to balance out
my $raf = \$"; ## \$LIST_SEPARATOR use another " # to balance out
my $opt::s = 0; ## s is no substitution here
my $opt_s = 0; ## s is no substitution here
my %opt = (s => 0); ## s is no substitution here
$opt{s} = 0; ## s is no substitution here
$opt_s =~ /\s+.../ ## s is no substitution here