Menu

#592 Patch for groovy mode

None
closed-accepted
None
5
2017-03-19
2016-09-06
No

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":


<begin>/</begin>
<end>/</end>

1 Attachments

Discussion

  • Egor Abramovich

    Egor Abramovich - 2016-09-14

    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>

     
  • Alan Ezust

    Alan Ezust - 2017-03-19
    • status: open --> closed-accepted
    • assigned_to: Alan Ezust
    • Group: -->
     
  • Alan Ezust

    Alan Ezust - 2017-03-19

    Committed 24658

     

Log in to post a comment.