diff options
author | Matt Merhar <mattmerhar@protonmail.com> | 2022-04-27 22:28:04 -0400 |
---|---|---|
committer | Christian Hergert <christian@hergert.me> | 2022-05-01 18:01:07 +0000 |
commit | e54d027db6101fb8f29b6d311994d23389bfbb1f (patch) | |
tree | f2c99e0df8b71d40054852b0098835494774b8e5 /tests | |
parent | 6b1ceec1eacdb651b3bd36ef5b85195c49062a64 (diff) | |
download | gtksourceview-e54d027db6101fb8f29b6d311994d23389bfbb1f.tar.gz |
perl.lang: fix POD =begin keyword
There were two issues:
- The first regex was matching =end as well
- The wrong capture variable was being referenced in the =end regex
These led to =end being completely ignored, causing syntax highlighting
to cease for anything after the initial =begin (including =cut).
This also modifies the file.pl test cases to include a section of POD
that'll break highlighting without this commit applied. An example of
__END__ was added as well. The POD in the file additionally now renders
properly with 'perldoc'.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/syntax-highlighting/file.pl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/syntax-highlighting/file.pl b/tests/syntax-highlighting/file.pl index 36742a41..4ac90ad7 100644 --- a/tests/syntax-highlighting/file.pl +++ b/tests/syntax-highlighting/file.pl @@ -102,16 +102,51 @@ sub login { } until /^\s+$/; } +=pod + =head1 EXAMPLE + B<collateindex.pl> B<-o> F<index.sgml> F<HTML.index> + =head1 EXIT STATUS + =over 5 + =item B<0> Success + =item B<1> Failure + =back + =head1 AUTHOR + Norm Walsh E<lt>ndw@nwalsh.comE<gt> Minor updates by Adam Di Carlo E<lt>adam@onshore.comE<gt> and Peter Eisentraut E<lt>peter_e@gmx.netE<gt> + +=begin html +<!-- +This is raw data ignored by POD processors. +=end not_the_end =cut +--> +=end html + +Still POD. + +=cut + +sub end { +=pod + +Here's another snippet of valid C<POD>. + +=cut + + my $foo = { bar => \*STDOUT }; +} + +__END__ + +if present, this data isn't supposed to be processed as Perl. |