mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +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
|
||||
[/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string
|
||||
[/"/, 'string', '@string' ],
|
||||
[/`/, "string", "@rawstring"],
|
||||
|
||||
// characters
|
||||
[/'[^\\']'/, 'string'],
|
||||
|
|
@ -162,5 +163,10 @@ export var language = <ILanguage> {
|
|||
[/\\./, 'string.escape.invalid'],
|
||||
[/"/, 'string', '@pop' ]
|
||||
],
|
||||
|
||||
rawstring: [
|
||||
[/[^\`]/, "string"],
|
||||
[/`/, "string", "@pop"]
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -1163,5 +1163,11 @@ testTokenization('go', [
|
|||
line: '}',
|
||||
tokens: [
|
||||
{ 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