Add backtick tests

This commit is contained in:
Nico Tonozzi 2016-09-20 13:11:53 -07:00
parent 52e39d313e
commit d71afeadce
2 changed files with 12 additions and 0 deletions

View file

@ -126,6 +126,7 @@ export var language = <ILanguage> {
// strings // strings
[/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string [/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string
[/"/, 'string', '@string' ], [/"/, 'string', '@string' ],
[/`/, "string", "@rawstring"],
// characters // characters
[/'[^\\']'/, 'string'], [/'[^\\']'/, 'string'],
@ -162,5 +163,10 @@ export var language = <ILanguage> {
[/\\./, 'string.escape.invalid'], [/\\./, 'string.escape.invalid'],
[/"/, 'string', '@pop' ] [/"/, 'string', '@pop' ]
], ],
rawstring: [
[/[^\`]/, "string"],
[/`/, "string", "@pop"]
],
}, },
}; };

View file

@ -1163,5 +1163,11 @@ testTokenization('go', [
line: '}', line: '}',
tokens: [ tokens: [
{ startIndex: 0, type: 'delimiter.curly.go' } { startIndex: 0, type: 'delimiter.curly.go' }
]}],
[{
line: '`Hello world() ""`',
tokens: [
{ startIndex: 0, type: 'string.go' }
]}] ]}]
]); ]);