[swift mode] Fix tokenizing of block comments
Closes https://github.com/codemirror/codemirror5/issues/6981
This commit is contained in:
parent
ccacc38263
commit
264ba931c4
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue