From: Werner Fink Date: Tue, 23 Jan 2018 14:26:43 +0000 (+0100) Subject: Add a patch from Josh Zenker to fix perl highlight X-Git-Tag: v1.7.rc~12 X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=enscript.git;a=commitdiff_plain;h=df5c7cf3ece4845b91e4b4849cc05db1ed1c8d6c;ds=sidebyside Add a patch from Josh Zenker to fix perl highlight If a hash/pound appears within parentheses, the rest of the line gets highlighted as though it were a comment, e.g. if ($#ARGV + 1 ne $EXPECTED_ARGS) { Signed-off-by: Werner Fink Signed-off-by: James Cloos --- diff --git a/states/hl/perl.st b/states/hl/perl.st index 418a146..161dae1 100644 --- a/states/hl/perl.st +++ b/states/hl/perl.st @@ -4,6 +4,7 @@ * * Author: Jim Villani, Logistics Management Institute (jvillani@lmi.org) * perl_pod mods by Gregor Purdy (gregor@focusresearch.com) + * perl_parens by Josh Zenker (josh.zenker@sig.com) */ state perl_pod extends Highlight @@ -58,6 +59,18 @@ state perl_bquot_string extends Highlight } } +state perl_parens extends Highlight +{ + /\\\\./ { + language_print ($0); + } + /\)/ { + language_print ($0); + return; + } +} + + state perl extends HighlightEntry { /* Comments. */ @@ -186,6 +199,12 @@ state perl extends HighlightEntry language_print ($0); call (perl_pod); } + + /* parentheses */ + /\(/ { + language_print ($0); + call (perl_parens); + } }