mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Merge pull request #10 from nicot/master
Go: add raw string literal syntax
This commit is contained in:
commit
ab254ceffc
2 changed files with 12 additions and 0 deletions
|
|
@ -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"]
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -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' }
|
||||||
]}]
|
]}]
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue