Skip to content

Commit

Permalink
[groovy mode] Stop parsing interpolated variable names when hitting w…
Browse files Browse the repository at this point in the history
…hitespace

Closes #7103
  • Loading branch information
marijnh committed Aug 28, 2024
1 parent 48d159a commit dd44c94
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mode/groovy/groovy.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ CodeMirror.defineMode("groovy", function(config) {

function tokenVariableDeref(stream, state) {
var next = stream.match(/^(\.|[\w\$_]+)/)
if (!next) {
state.tokenize.pop()
return state.tokenize[state.tokenize.length-1](stream, state)
}
if (!next || !stream.match(next[0] == "." ? /^[\w$_]/ : /^\./)) state.tokenize.pop()
if (!next) return state.tokenize[state.tokenize.length-1](stream, state)
return next[0] == "." ? null : "variable"
}

Expand Down

0 comments on commit dd44c94

Please sign in to comment.