mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
[clojure] Add a word boundary to ensure exact matches for (comment ...).
This commit is contained in:
parent
6f6f1b43f0
commit
c77f11b1b0
2 changed files with 26 additions and 2 deletions
|
|
@ -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: [
|
||||
|
|
|
|||
|
|
@ -762,13 +762,13 @@ export const language = <ILanguage>{
|
|||
whitespace: [
|
||||
[/\s+/, 'white'],
|
||||
[/;.*$/, 'comment'],
|
||||
[/\(comment/, 'comment', '@comment'],
|
||||
[/\(comment\b/, 'comment', '@comment'],
|
||||
],
|
||||
|
||||
comment: [
|
||||
[/\(/, 'comment', '@push'],
|
||||
[/\)/, 'comment', '@pop'],
|
||||
[/[^)]/, 'comment'],
|
||||
[/[^()]/, 'comment'],
|
||||
],
|
||||
|
||||
string: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue