Skip to content

Commit

Permalink
Fix bad handling of interpolated variables in the Groovy mode
Browse files Browse the repository at this point in the history
FIX: Fix an issue in the Groovy mode where himBHsinterpolated variable style would
continue after whitespace.

Issue codemirror/codemirror5#7103
  • Loading branch information
marijnh committed Aug 28, 2024
1 parent 734b54d commit 2675b58
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mode/groovy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit 2675b58

Please sign in to comment.