Skip to content

Commit

Permalink
Add an escaped quote to the sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Mar 11, 2018
1 parent 8993c2d commit b72c310
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 20 deletions.
2 changes: 1 addition & 1 deletion fixtures/grammar/src/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* It will contain a mix of stuff.
*/

const greeting = 'Hello World.';
const greeting = 'Hello World. Don\'t worry, be happy.';
// alias for uniqueFilterFnGenerator
export const uniqueFn = uniqueFilterFnGenerator;

Expand Down
31 changes: 25 additions & 6 deletions fixtures/grammar/tokenized/sample.ts.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"tokens": []
},
{
"line": "const greeting = 'Hello World.';",
"line": "const greeting = 'Hello World. Don\\'t worry, be happy.';",
"lineNumber": 10,
"tokens": [
{
Expand Down Expand Up @@ -216,16 +216,35 @@
},
{
"startIndex": 18,
"endIndex": 30,
"endIndex": 34,
"scopes": [
"source.ts",
"meta.var.expr.ts",
"string.quoted.single.ts"
]
},
{
"startIndex": 30,
"endIndex": 31,
"startIndex": 34,
"endIndex": 36,
"scopes": [
"source.ts",
"meta.var.expr.ts",
"string.quoted.single.ts",
"constant.character.escape.ts"
]
},
{
"startIndex": 36,
"endIndex": 54,
"scopes": [
"source.ts",
"meta.var.expr.ts",
"string.quoted.single.ts"
]
},
{
"startIndex": 54,
"endIndex": 55,
"scopes": [
"source.ts",
"meta.var.expr.ts",
Expand All @@ -234,8 +253,8 @@
]
},
{
"startIndex": 31,
"endIndex": 32,
"startIndex": 55,
"endIndex": 56,
"scopes": [
"source.ts",
"punctuation.terminator.statement.ts"
Expand Down
6 changes: 4 additions & 2 deletions fixtures/grammar/tokenized/sample.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

**9:** *blank line*

**10:** ```const greeting = 'Hello World.';```
**10:** ```const greeting = 'Hello World. Don\'t worry, be happy.';```

| text | scope |
| -- | -- |
Expand All @@ -64,7 +64,9 @@
| ``` = ``` | source.ts meta.var.expr.ts keyword.operator.assignment.ts |
| ``` ``` | source.ts meta.var.expr.ts |
| ``` ' ``` | source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.begin.ts |
| ``` Hello World. ``` | source.ts meta.var.expr.ts string.quoted.single.ts |
| ``` Hello World. Don ``` | source.ts meta.var.expr.ts string.quoted.single.ts |
| ``` \' ``` | source.ts meta.var.expr.ts string.quoted.single.ts constant.character.escape.ts |
| ``` t worry, be happy. ``` | source.ts meta.var.expr.ts string.quoted.single.ts |
| ``` ' ``` | source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.end.ts |
| ``` ; ``` | source.ts punctuation.terminator.statement.ts |

Expand Down
25 changes: 14 additions & 11 deletions fixtures/grammar/tokenized/sample.ts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,20 @@ sample.ts

9

10 const greeting = 'Hello World.';
const => source.ts meta.var.expr.ts storage.type.ts
=> source.ts meta.var.expr.ts
greeting => source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
=> source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
= => source.ts meta.var.expr.ts keyword.operator.assignment.ts
=> source.ts meta.var.expr.ts
' => source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.begin.ts
Hello World. => source.ts meta.var.expr.ts string.quoted.single.ts
' => source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.end.ts
; => source.ts punctuation.terminator.statement.ts
10 const greeting = 'Hello World. Don\'t worry, be happy.';
const => source.ts meta.var.expr.ts storage.type.ts
=> source.ts meta.var.expr.ts
greeting => source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts
variable.other.readwrite.ts
=> source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
= => source.ts meta.var.expr.ts keyword.operator.assignment.ts
=> source.ts meta.var.expr.ts
' => source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.begin.ts
Hello World. Don => source.ts meta.var.expr.ts string.quoted.single.ts
\' => source.ts meta.var.expr.ts string.quoted.single.ts constant.character.escape.ts
t worry, be happy. => source.ts meta.var.expr.ts string.quoted.single.ts
' => source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.end.ts
; => source.ts punctuation.terminator.statement.ts

11 // alias for uniqueFilterFnGenerator
// => source.ts comment.line.double-slash.ts punctuation.definition.comment.ts
Expand Down

0 comments on commit b72c310

Please sign in to comment.