PreviousNextTracker indexSee it online !

(35/39) 592 - Patch for groovy mode

Problem:
Regular expressions in Groovy break highlighting.
For example, see the following code that would be highlighted incorrectly:

def matcher = s =~ /\'([a-zA-Z_]+)\'/
if (matcher.size()==0) {
println "Skipping line $lno: $t"
} else {
result.add(matcher[0][1]);
}

Fix:
Regexp delimiters should be added to "groovy.xml":

<SPAN TYPE="LITERAL1" ESCAPE="\">
<BEGIN>/</BEGIN>
<END>/</END>
</SPAN>

Submitted egor_abramovich - 2016-09-06 17:44:20.276000 Assigned
Priority 5 Labels
Status open Group None
Resolution None

Comments

2016-09-14 08:40:25.051000
egor_abramovich

Just noticed that the patch above breaks one-line comments. This should be handled the same way as in JavaScript. Patch should be

<EOL_SPAN TYPE="COMMENT1">//</EOL_SPAN>

<SEQ_REGEXP TYPE="MARKUP" HASH_CHAR="/" AT_WORD_START="TRUE">/[^\p{Blank}]*?/</SEQ_REGEXP>

groovy.xml (7.1Kio)