This commit is contained in:
Alex Dima 2018-12-05 23:40:45 +01:00
parent 4054a20fdc
commit 8f7537dee5
2 changed files with 21 additions and 0 deletions

View file

@ -481,6 +481,26 @@ testTokenization('typescript', [
] ]
}], }],
[{
line: 'var x = !/`/.test(\'a\');',
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: 'delimiter.ts' },
{ startIndex: 9, type: 'regexp.ts' },
{ startIndex: 12, type: 'delimiter.ts' },
{ startIndex: 13, type: 'identifier.ts' },
{ startIndex: 17, type: 'delimiter.parenthesis.ts' },
{ startIndex: 18, type: 'string.ts' },
{ startIndex: 21, type: 'delimiter.parenthesis.ts' },
{ startIndex: 22, type: 'delimiter.ts' },
]
}],
[{ [{
line: '/foo/', line: '/foo/',
tokens: [ tokens: [

View file

@ -135,6 +135,7 @@ export const language = {
// delimiters and operators // delimiters and operators
[/[()\[\]]/, '@brackets'], [/[()\[\]]/, '@brackets'],
[/[<>](?!@symbols)/, '@brackets'], [/[<>](?!@symbols)/, '@brackets'],
[/!(?=([^=]|$))/, 'delimiter'],
[/@symbols/, { [/@symbols/, {
cases: { cases: {
'@operators': 'delimiter', '@operators': 'delimiter',