[swift mode] Fix tokenizing of block comments

Closes https://github.com/codemirror/codemirror5/issues/6981
This commit is contained in:
Marijn Haverbeke 2022-09-06 15:15:02 +02:00
parent ccacc38263
commit 264ba931c4
1 changed files with 2 additions and 4 deletions

View File

@ -143,14 +143,12 @@
function tokenComment(stream, state) {
var ch
while (true) {
stream.match(/^[^/*]+/, true)
ch = stream.next()
if (!ch) break
while (ch = stream.next()) {
if (ch === "/" && stream.eat("*")) {
state.tokenize.push(tokenComment)
} else if (ch === "*" && stream.eat("/")) {
state.tokenize.pop()
break
}
}
return "comment"