diff --git a/mode/groovy/groovy.js b/mode/groovy/groovy.js index 89d0fe0854..24d886ebb1 100644 --- a/mode/groovy/groovy.js +++ b/mode/groovy/groovy.js @@ -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" }