Skip to content

Commit dd44c94

Browse files
committed
[groovy mode] Stop parsing interpolated variable names when hitting whitespace
Closes #7103
1 parent 48d159a commit dd44c94

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mode/groovy/groovy.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,8 @@ CodeMirror.defineMode("groovy", function(config) {
129129

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

0 commit comments

Comments
 (0)