bug-enscript
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-enscript] [PATCH 1/8] Add a patch from Josh Zenker to fix perl high


From: Werner Fink
Subject: [bug-enscript] [PATCH 1/8] Add a patch from Josh Zenker to fix perl highlight
Date: Tue, 23 Jan 2018 15:26:43 +0100

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 <address@hidden>
---
 states/hl/perl.st | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git states/hl/perl.st states/hl/perl.st
index 418a146..161dae1 100644
--- states/hl/perl.st
+++ states/hl/perl.st
@@ -4,6 +4,7 @@
  *
  * Author: Jim Villani, Logistics Management Institute (address@hidden)
  *         perl_pod mods by Gregor Purdy (address@hidden)
+ *         perl_parens by Josh Zenker (address@hidden)
  */
 
 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);
+  }
 }
 
 
-- 
2.12.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]