Skip to content

Commit 264ba93

Browse files
committed
[swift mode] Fix tokenizing of block comments
Closes #6981
1 parent ccacc38 commit 264ba93

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mode/swift/swift.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,12 @@
143143

144144
function tokenComment(stream, state) {
145145
var ch
146-
while (true) {
147-
stream.match(/^[^/*]+/, true)
148-
ch = stream.next()
149-
if (!ch) break
146+
while (ch = stream.next()) {
150147
if (ch === "/" && stream.eat("*")) {
151148
state.tokenize.push(tokenComment)
152149
} else if (ch === "*" && stream.eat("/")) {
153150
state.tokenize.pop()
151+
break
154152
}
155153
}
156154
return "comment"

0 commit comments

Comments
 (0)