mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
This commit is contained in:
parent
b6b3e0a0db
commit
9de193a100
2 changed files with 21 additions and 1 deletions
|
|
@ -798,6 +798,26 @@ testTokenization('typescript', [
|
|||
{ startIndex: 26, type: 'delimiter.bracket.ts' },
|
||||
{ startIndex: 27, type: 'string.ts' },
|
||||
]
|
||||
}],
|
||||
|
||||
[{
|
||||
line: 'let x = 2 / 2; //asd',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.ts' },
|
||||
{ startIndex: 3, type: '' },
|
||||
{ startIndex: 4, type: 'identifier.ts' },
|
||||
{ startIndex: 5, type: '' },
|
||||
{ startIndex: 6, type: 'delimiter.ts' },
|
||||
{ startIndex: 7, type: '' },
|
||||
{ startIndex: 8, type: 'number.ts' },
|
||||
{ startIndex: 9, type: '' },
|
||||
{ startIndex: 10, type: 'delimiter.ts' },
|
||||
{ startIndex: 11, type: '' },
|
||||
{ startIndex: 12, type: 'number.ts' },
|
||||
{ startIndex: 13, type: 'delimiter.ts' },
|
||||
{ startIndex: 14, type: '' },
|
||||
{ startIndex: 15, type: 'comment.ts' },
|
||||
]
|
||||
}]
|
||||
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ export const language = {
|
|||
{ include: '@whitespace' },
|
||||
|
||||
// regular expression: ensure it is terminated before beginning (otherwise it is an opeator)
|
||||
[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/, { token: 'regexp', bracket: '@open', next: '@regexp' }],
|
||||
[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/, { token: 'regexp', bracket: '@open', next: '@regexp' }],
|
||||
|
||||
// delimiters and operators
|
||||
[/[()\[\]]/, '@brackets'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue