summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMatt Merhar <mattmerhar@protonmail.com>2022-04-27 22:28:04 -0400
committerChristian Hergert <christian@hergert.me>2022-05-01 18:01:07 +0000
commite54d027db6101fb8f29b6d311994d23389bfbb1f (patch)
treef2c99e0df8b71d40054852b0098835494774b8e5 /data
parent6b1ceec1eacdb651b3bd36ef5b85195c49062a64 (diff)
downloadgtksourceview-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 'data')
-rw-r--r--data/language-specs/perl.lang4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/language-specs/perl.lang b/data/language-specs/perl.lang
index 5764dd44..4b38ec4b 100644
--- a/data/language-specs/perl.lang
+++ b/data/language-specs/perl.lang
@@ -1022,7 +1022,7 @@ FIXME: =pod should require an empty line before/after, as written in perlpod
</context>
<context id="pod" style-ref="pod" class-disabled="no-spell-check">
- <start>^(?=(=[a-z]))</start>
+ <start>^(?=(=(?!end))[a-z])</start>
<end>^=(cut)$</end>
<include>
<context sub-pattern="1" where="end" style-ref="pod-keyword"/>
@@ -1033,7 +1033,7 @@ FIXME: =pod should require an empty line before/after, as written in perlpod
</context>
<context>
<start>^=(begin)\s+(.*)$</start>
- <end>^=(end)\s+\%{1@start}$</end>
+ <end>^=(end)\s+\%{2@start}$</end>
<include>
<context sub-pattern="1" where="start" style-ref="pod-keyword"/>
<context sub-pattern="1" where="end" style-ref="pod-keyword"/>