diff --git a/src/go.ts b/src/go.ts index 3ec564b5..dda49fbd 100644 --- a/src/go.ts +++ b/src/go.ts @@ -126,6 +126,7 @@ export var language = { // strings [/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string [/"/, 'string', '@string' ], + [/`/, "string", "@rawstring"], // characters [/'[^\\']'/, 'string'], @@ -162,5 +163,10 @@ export var language = { [/\\./, 'string.escape.invalid'], [/"/, 'string', '@pop' ] ], + + rawstring: [ + [/[^\`]/, "string"], + [/`/, "string", "@pop"] + ], }, }; \ No newline at end of file diff --git a/test/go.test.ts b/test/go.test.ts index b8a098d7..25cc4ef8 100644 --- a/test/go.test.ts +++ b/test/go.test.ts @@ -1163,5 +1163,11 @@ testTokenization('go', [ line: '}', tokens: [ { startIndex: 0, type: 'delimiter.curly.go' } + ]}], + + [{ + line: '`Hello world() ""`', + tokens: [ + { startIndex: 0, type: 'string.go' } ]}] ]);