[gtksourceview] groovy.lang: fix highlighting for dollar slashy strings starting with /



commit 1880e41812e3123a9236a87560ebdc39203a933b
Author: Роман Донченко <dpb corrigendum ru>
Date:   Sun Jan 21 23:20:52 2018 +0300

    groovy.lang: fix highlighting for dollar slashy strings starting with /
    
    The look-ahead assertion is wrong; what _actually_ can't follow `$/` is
    not `/`, but `/$`. In other words, a dollar slashy string can't be empty.
    
    Also, remove the comment about the requirements on the on the preceding
    token, because those were removed in the in-development versions of Groovy
    (not sure when exactly, but they're gone in 3.0.0-alpha-1).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792762

 data/language-specs/groovy.lang |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/data/language-specs/groovy.lang b/data/language-specs/groovy.lang
index a91ae7a..a991433 100644
--- a/data/language-specs/groovy.lang
+++ b/data/language-specs/groovy.lang
@@ -172,18 +172,11 @@
 
     <context id="dollar-slashy-string" style-ref="string" class="string">
       <start extended="true">
-        # Strictly speaking, a dollar slashy string has the same requirements on the
-        # preceding token as a plain slashy string, but if those requirements aren't
-        # met, it's parsed as a dollar followed by a division operator, which isn't
-        # legal. So we don't bother with accounting for that case.
-
         \$/
 
-        # We will, however, account for the case when there's a slash right after
-        # the initial $/. In that case, the construct is actually parsed as a dollar
-        # followed by a single-line comment. Which is still illegal... but as least
-        # this check is easy to implement.
-        (?=[^/])
+        # Dollar slashy strings can't be empty (a would-be empty one is parsed
+        # as a dollar followed by a single-line comment instead).
+        (?! /\$)
       </start>
       <end>/\$</end>
       <include>


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