Skip to content

Commit

Permalink
Make sure last slash is included in block comment tokens
Browse files Browse the repository at this point in the history
FIX: Fix a bug where the slash at the end of block comments wasn't considered
part of the comment token.

See https://discuss.codemirror.net/t/highlighting-in-block-comment-lang-sql/4437
  • Loading branch information
marijnh committed May 27, 2022
1 parent 1404c7d commit 35c0a4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function tokensFor(d: Dialect) {
input.advance()
if (prev == Ch.Star && (input as any).next == Ch.Slash) {
depth--
if (!depth) break
if (!depth) { input.advance(); break }
prev = -1
} else if (prev == Ch.Slash && input.next == Ch.Star) {
depth++
Expand Down

0 comments on commit 35c0a4a

Please sign in to comment.