diff --git a/mode/groovy.js b/mode/groovy.js index a9f01e2..74fac51 100644 --- a/mode/groovy.js +++ b/mode/groovy.js @@ -115,10 +115,8 @@ function tokenBaseUntilBrace() { 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" }