Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Add backtick tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicot committed Sep 20, 2016
1 parent 52e39d3 commit d71afea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export var language = <ILanguage> {
// strings
[/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string
[/"/, 'string', '@string' ],
[/`/, "string", "@rawstring"],

// characters
[/'[^\\']'/, 'string'],
Expand Down Expand Up @@ -162,5 +163,10 @@ export var language = <ILanguage> {
[/\\./, 'string.escape.invalid'],
[/"/, 'string', '@pop' ]
],

rawstring: [
[/[^\`]/, "string"],
[/`/, "string", "@pop"]
],
},
};
6 changes: 6 additions & 0 deletions test/go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1163,5 +1163,11 @@ testTokenization('go', [
line: '}',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.go' }
]}],

[{
line: '`Hello world() ""`',
tokens: [
{ startIndex: 0, type: 'string.go' }
]}]
]);

0 comments on commit d71afea

Please # to comment.