diff --git a/src/clojure/clojure.test.ts b/src/clojure/clojure.test.ts index e4098fa1..80ae4050 100644 --- a/src/clojure/clojure.test.ts +++ b/src/clojure/clojure.test.ts @@ -792,6 +792,30 @@ testTokenization('clojure', [ {startIndex: 0, type: 'comment.clj'}, ], }, + { + line: '(comments foo bar)', + tokens: [ + {startIndex: 0, type: 'delimiter.parenthesis.clj'}, + {startIndex: 1, type: 'identifier.clj'}, + {startIndex: 9, type: 'white.clj'}, + {startIndex: 10, type: 'identifier.clj'}, + {startIndex: 13, type: 'white.clj'}, + {startIndex: 14, type: 'identifier.clj'}, + {startIndex: 17, type: 'delimiter.parenthesis.clj'}, + ] + }, + { + line: '(comment6 foo bar)', + tokens: [ + {startIndex: 0, type: 'delimiter.parenthesis.clj'}, + {startIndex: 1, type: 'identifier.clj'}, + {startIndex: 9, type: 'white.clj'}, + {startIndex: 10, type: 'identifier.clj'}, + {startIndex: 13, type: 'white.clj'}, + {startIndex: 14, type: 'identifier.clj'}, + {startIndex: 17, type: 'delimiter.parenthesis.clj'}, + ] + }, { line: '(comment foo', tokens: [ diff --git a/src/clojure/clojure.ts b/src/clojure/clojure.ts index df779450..03beb5b9 100644 --- a/src/clojure/clojure.ts +++ b/src/clojure/clojure.ts @@ -762,13 +762,13 @@ export const language = { whitespace: [ [/\s+/, 'white'], [/;.*$/, 'comment'], - [/\(comment/, 'comment', '@comment'], + [/\(comment\b/, 'comment', '@comment'], ], comment: [ [/\(/, 'comment', '@push'], [/\)/, 'comment', '@pop'], - [/[^)]/, 'comment'], + [/[^()]/, 'comment'], ], string: [