Support Spread and Rest operator

Fixes #291
This commit is contained in:
Sheetal Nandi 2016-10-07 13:12:39 -07:00
Родитель 10f29f53a3
Коммит 67b3e04d13
7 изменённых файлов: 1109 добавлений и 158 удалений

Просмотреть файл

@ -106,8 +106,8 @@ repository:
- include: '#array-binding-pattern'
- name: variable.other.readwrite.ts
match: ([_$[:alpha:]][_$[:alnum:]]*)
- name: variable.other.readwrite.ts
match: ([_$[:alpha:]][_$[:alnum:]]*)
- include: '#object-binding-pattern'
- include: '#destructuring-variable-rest'
- include: '#punctuation-comma'
array-binding-element:
@ -115,14 +115,20 @@ repository:
- include: '#comment'
- include: '#object-binding-pattern'
- include: '#array-binding-pattern'
- name: variable.other.readwrite.ts
match: ([_$[:alpha:]][_$[:alnum:]]*)
- include: '#destructuring-variable-rest'
- include: '#punctuation-comma'
destructuring-variable-rest:
match: (?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)
captures:
'1': { name: keyword.operator.rest.ts }
'2': { name: variable.other.readwrite.ts }
object-binding-pattern:
begin: \{
begin: (?:(\.\.\.)\s*)?(\{)
beginCaptures:
'0': { name: punctuation.definition.binding-pattern.object.ts }
'1': { name: keyword.operator.rest.ts }
'2': { name: punctuation.definition.binding-pattern.object.ts }
end: \}
endCaptures:
'0': { name: punctuation.definition.binding-pattern.object.ts }
@ -130,9 +136,10 @@ repository:
- include: '#object-binding-element'
array-binding-pattern:
begin: \[
begin: (?:(\.\.\.)\s*)?(\[)
beginCaptures:
'0': { name: punctuation.definition.binding-pattern.array.ts }
'1': { name: keyword.operator.rest.ts }
'2': { name: punctuation.definition.binding-pattern.array.ts }
end: \]
endCaptures:
'0': { name: punctuation.definition.binding-pattern.array.ts }
@ -171,8 +178,7 @@ repository:
- include: '#ternary-expression'
- include: '#new-expr'
- include: '#object-literal'
- include: '#expression-operator'
- include: '#operators'
- include: '#expression-operators'
- include: '#support-objects'
- include: '#function-call'
- include: '#identifiers'
@ -457,6 +463,12 @@ repository:
- include: '#method-declaration'
- include: '#indexer-declaration'
- include: '#type-annotation'
- begin: \.\.\.
beginCaptures:
'0': { name: keyword.operator.spread.ts }
end: '(?=\}|;|,|$)|(?<=\})'
patterns:
- include: '#type'
- include: '#punctuation-comma'
- include: '#punctuation-semicolon'
@ -609,7 +621,7 @@ repository:
match: '(?:\s*\b(public|private|protected)\b\s+)?(\.\.\.)?\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\s*(\??)'
captures:
'1': { name: storage.modifier.ts }
'2': { name: keyword.operator.spread.ts }
'2': { name: keyword.operator.rest.ts }
'3': { name: variable.parameter.ts }
'4': { name: keyword.operator.optional.ts }
@ -647,8 +659,8 @@ repository:
- include: '#parameter-array-binding-pattern'
- name: variable.parameter.ts
match: ([_$[:alpha:]][_$[:alnum:]]*)
- name: variable.parameter.ts
match: ([_$[:alpha:]][_$[:alnum:]]*)
- include: '#parameter-object-binding-pattern'
- include: '#destructuring-parameter-rest'
- include: '#punctuation-comma'
parameter-array-binding-element:
@ -656,14 +668,20 @@ repository:
- include: '#comment'
- include: '#parameter-object-binding-pattern'
- include: '#parameter-array-binding-pattern'
- name: variable.parameter.ts
match: ([_$[:alpha:]][_$[:alnum:]]*)
- include: '#destructuring-parameter-rest'
- include: '#punctuation-comma'
destructuring-parameter-rest:
match: (?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)
captures:
'1': { name: keyword.operator.rest.ts }
'2': { name: variable.parameter.ts }
parameter-object-binding-pattern:
begin: \{
begin: (?:(\.\.\.)\s*)?(\{)
beginCaptures:
'0': { name: punctuation.definition.binding-pattern.object.ts }
'1': { name: keyword.operator.rest.ts }
'2': { name: punctuation.definition.binding-pattern.object.ts }
end: \}
endCaptures:
'0': { name: punctuation.definition.binding-pattern.object.ts }
@ -671,9 +689,10 @@ repository:
- include: '#parameter-object-binding-element'
parameter-array-binding-pattern:
begin: \[
begin: (?:(\.\.\.)\s*)?(\[)
beginCaptures:
'0': { name: punctuation.definition.binding-pattern.array.ts }
'1': { name: keyword.operator.rest.ts }
'2': { name: punctuation.definition.binding-pattern.array.ts }
end: \]
endCaptures:
'0': { name: punctuation.definition.binding-pattern.array.ts }
@ -723,11 +742,10 @@ repository:
- include: '#numeric-literal'
- include: '#type-primitive'
- include: '#type-builtin-literals'
- include: '#typeof-operator'
- include: '#type-parameters'
- include: '#type-tuple'
- include: '#type-object'
- include: '#type-operator'
- include: '#type-operators'
- include: '#type-fn-type-parameters'
- include: '#type-paren-or-function-parameters'
- include: '#type-function-return-type'
@ -814,9 +832,11 @@ repository:
patterns:
- include: '#function-parameters'
type-operator:
name: keyword.operator.type.ts
match: '[&|]'
type-operators:
patterns:
- include: '#typeof-operator'
- name: keyword.operator.type.ts
match: '[&|]'
type-function-return-type:
name: meta.type.function.return.ts
@ -1335,13 +1355,20 @@ repository:
end: (?=,|\})
patterns:
- include: '#expression'
- name: meta.object.member.ts
begin: \.\.\.
beginCaptures:
'0': { name: keyword.operator.spread.ts }
end: (?=,|\})
patterns:
- include: '#expression'
- name: meta.object.member.ts
match: ([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\})
captures:
'1': { name: variable.other.readwrite.ts }
- include: '#punctuation-comma'
expression-operator:
expression-operators:
patterns:
- name: keyword.control.flow.ts
match: (?<!\.|\$)\b(await)\b(?!\$)
@ -1364,13 +1391,8 @@ repository:
end: (?=$|[;,})\]])
patterns:
- include: '#type'
typeof-operator:
name: keyword.operator.typeof.ts
match: (?<!\.|\$)\btypeof\b(?!\$)
operators:
patterns:
- name: keyword.operator.spread.ts
match: \.\.\.
- name: keyword.operator.assignment.compound.ts
match: \*=|(?<!\()/=|%=|\+=|\-=
- name: keyword.operator.assignment.compound.bitwise.ts
@ -1392,6 +1414,10 @@ repository:
- name: keyword.operator.arithmetic.ts
match: '%|\*|/|-|\+'
typeof-operator:
name: keyword.operator.typeof.ts
match: (?<!\.|\$)\btypeof\b(?!\$)
arrow-function:
patterns:
- name: meta.arrow.ts

Просмотреть файл

@ -338,10 +338,12 @@
</array>
</dict>
<dict>
<key>name</key>
<string>variable.other.readwrite.ts</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>include</key>
<string>#object-binding-pattern</string>
</dict>
<dict>
<key>include</key>
<string>#destructuring-variable-rest</string>
</dict>
<dict>
<key>include</key>
@ -366,10 +368,8 @@
<string>#array-binding-pattern</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.readwrite.ts</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>include</key>
<string>#destructuring-variable-rest</string>
</dict>
<dict>
<key>include</key>
@ -377,13 +377,36 @@
</dict>
</array>
</dict>
<key>destructuring-variable-rest</key>
<dict>
<key>match</key>
<string>(?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.readwrite.ts</string>
</dict>
</dict>
</dict>
<key>object-binding-pattern</key>
<dict>
<key>begin</key>
<string>\{</string>
<string>(?:(\.\.\.)\s*)?(\{)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.binding-pattern.object.ts</string>
@ -410,10 +433,15 @@
<key>array-binding-pattern</key>
<dict>
<key>begin</key>
<string>\[</string>
<string>(?:(\.\.\.)\s*)?(\[)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.binding-pattern.array.ts</string>
@ -541,11 +569,7 @@
</dict>
<dict>
<key>include</key>
<string>#expression-operator</string>
</dict>
<dict>
<key>include</key>
<string>#operators</string>
<string>#expression-operators</string>
</dict>
<dict>
<key>include</key>
@ -1497,6 +1521,27 @@
<key>include</key>
<string>#type-annotation</string>
</dict>
<dict>
<key>begin</key>
<string>\.\.\.</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.operator.spread.ts</string>
</dict>
</dict>
<key>end</key>
<string>(?=\}|;|,|$)|(?&lt;=\})</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#type</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#punctuation-comma</string>
@ -1994,7 +2039,7 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.spread.ts</string>
<string>keyword.operator.rest.ts</string>
</dict>
<key>3</key>
<dict>
@ -2121,10 +2166,12 @@
</array>
</dict>
<dict>
<key>name</key>
<string>variable.parameter.ts</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>include</key>
<string>#parameter-object-binding-pattern</string>
</dict>
<dict>
<key>include</key>
<string>#destructuring-parameter-rest</string>
</dict>
<dict>
<key>include</key>
@ -2149,10 +2196,8 @@
<string>#parameter-array-binding-pattern</string>
</dict>
<dict>
<key>name</key>
<string>variable.parameter.ts</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>include</key>
<string>#destructuring-parameter-rest</string>
</dict>
<dict>
<key>include</key>
@ -2160,13 +2205,36 @@
</dict>
</array>
</dict>
<key>destructuring-parameter-rest</key>
<dict>
<key>match</key>
<string>(?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.parameter.ts</string>
</dict>
</dict>
</dict>
<key>parameter-object-binding-pattern</key>
<dict>
<key>begin</key>
<string>\{</string>
<string>(?:(\.\.\.)\s*)?(\{)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.binding-pattern.object.ts</string>
@ -2193,10 +2261,15 @@
<key>parameter-array-binding-pattern</key>
<dict>
<key>begin</key>
<string>\[</string>
<string>(?:(\.\.\.)\s*)?(\[)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.binding-pattern.array.ts</string>
@ -2344,10 +2417,6 @@
<key>include</key>
<string>#type-builtin-literals</string>
</dict>
<dict>
<key>include</key>
<string>#typeof-operator</string>
</dict>
<dict>
<key>include</key>
<string>#type-parameters</string>
@ -2362,7 +2431,7 @@
</dict>
<dict>
<key>include</key>
<string>#type-operator</string>
<string>#type-operators</string>
</dict>
<dict>
<key>include</key>
@ -2563,12 +2632,21 @@
</dict>
</array>
</dict>
<key>type-operator</key>
<key>type-operators</key>
<dict>
<key>name</key>
<string>keyword.operator.type.ts</string>
<key>match</key>
<string>[&amp;|]</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#typeof-operator</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.type.ts</string>
<key>match</key>
<string>[&amp;|]</string>
</dict>
</array>
</dict>
<key>type-function-return-type</key>
<dict>
@ -3722,6 +3800,29 @@
</dict>
</array>
</dict>
<dict>
<key>name</key>
<string>meta.object.member.ts</string>
<key>begin</key>
<string>\.\.\.</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.operator.spread.ts</string>
</dict>
</dict>
<key>end</key>
<string>(?=,|\})</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#expression</string>
</dict>
</array>
</dict>
<dict>
<key>name</key>
<string>meta.object.member.ts</string>
@ -3742,7 +3843,7 @@
</dict>
</array>
</dict>
<key>expression-operator</key>
<key>expression-operators</key>
<dict>
<key>patterns</key>
<array>
@ -3813,19 +3914,12 @@
</dict>
</array>
</dict>
</array>
</dict>
<key>typeof-operator</key>
<dict>
<key>name</key>
<string>keyword.operator.typeof.ts</string>
<key>match</key>
<string>(?&lt;!\.|\$)\btypeof\b(?!\$)</string>
</dict>
<key>operators</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>name</key>
<string>keyword.operator.spread.ts</string>
<key>match</key>
<string>\.\.\.</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.assignment.compound.ts</string>
@ -3888,6 +3982,13 @@
</dict>
</array>
</dict>
<key>typeof-operator</key>
<dict>
<key>name</key>
<string>keyword.operator.typeof.ts</string>
<key>match</key>
<string>(?&lt;!\.|\$)\btypeof\b(?!\$)</string>
</dict>
<key>arrow-function</key>
<dict>
<key>patterns</key>

Просмотреть файл

@ -338,10 +338,12 @@
</array>
</dict>
<dict>
<key>name</key>
<string>variable.other.readwrite.tsx</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>include</key>
<string>#object-binding-pattern</string>
</dict>
<dict>
<key>include</key>
<string>#destructuring-variable-rest</string>
</dict>
<dict>
<key>include</key>
@ -366,10 +368,8 @@
<string>#array-binding-pattern</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.readwrite.tsx</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>include</key>
<string>#destructuring-variable-rest</string>
</dict>
<dict>
<key>include</key>
@ -377,13 +377,36 @@
</dict>
</array>
</dict>
<key>destructuring-variable-rest</key>
<dict>
<key>match</key>
<string>(?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.readwrite.tsx</string>
</dict>
</dict>
</dict>
<key>object-binding-pattern</key>
<dict>
<key>begin</key>
<string>\{</string>
<string>(?:(\.\.\.)\s*)?(\{)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.binding-pattern.object.tsx</string>
@ -410,10 +433,15 @@
<key>array-binding-pattern</key>
<dict>
<key>begin</key>
<string>\[</string>
<string>(?:(\.\.\.)\s*)?(\[)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.binding-pattern.array.tsx</string>
@ -545,11 +573,7 @@
</dict>
<dict>
<key>include</key>
<string>#expression-operator</string>
</dict>
<dict>
<key>include</key>
<string>#operators</string>
<string>#expression-operators</string>
</dict>
<dict>
<key>include</key>
@ -1501,6 +1525,27 @@
<key>include</key>
<string>#type-annotation</string>
</dict>
<dict>
<key>begin</key>
<string>\.\.\.</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.operator.spread.tsx</string>
</dict>
</dict>
<key>end</key>
<string>(?=\}|;|,|$)|(?&lt;=\})</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#type</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#punctuation-comma</string>
@ -1998,7 +2043,7 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.spread.tsx</string>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>3</key>
<dict>
@ -2125,10 +2170,12 @@
</array>
</dict>
<dict>
<key>name</key>
<string>variable.parameter.tsx</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>include</key>
<string>#parameter-object-binding-pattern</string>
</dict>
<dict>
<key>include</key>
<string>#destructuring-parameter-rest</string>
</dict>
<dict>
<key>include</key>
@ -2153,10 +2200,8 @@
<string>#parameter-array-binding-pattern</string>
</dict>
<dict>
<key>name</key>
<string>variable.parameter.tsx</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>include</key>
<string>#destructuring-parameter-rest</string>
</dict>
<dict>
<key>include</key>
@ -2164,13 +2209,36 @@
</dict>
</array>
</dict>
<key>destructuring-parameter-rest</key>
<dict>
<key>match</key>
<string>(?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.parameter.tsx</string>
</dict>
</dict>
</dict>
<key>parameter-object-binding-pattern</key>
<dict>
<key>begin</key>
<string>\{</string>
<string>(?:(\.\.\.)\s*)?(\{)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.binding-pattern.object.tsx</string>
@ -2197,10 +2265,15 @@
<key>parameter-array-binding-pattern</key>
<dict>
<key>begin</key>
<string>\[</string>
<string>(?:(\.\.\.)\s*)?(\[)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.rest.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.binding-pattern.array.tsx</string>
@ -2348,10 +2421,6 @@
<key>include</key>
<string>#type-builtin-literals</string>
</dict>
<dict>
<key>include</key>
<string>#typeof-operator</string>
</dict>
<dict>
<key>include</key>
<string>#type-parameters</string>
@ -2366,7 +2435,7 @@
</dict>
<dict>
<key>include</key>
<string>#type-operator</string>
<string>#type-operators</string>
</dict>
<dict>
<key>include</key>
@ -2567,12 +2636,21 @@
</dict>
</array>
</dict>
<key>type-operator</key>
<key>type-operators</key>
<dict>
<key>name</key>
<string>keyword.operator.type.tsx</string>
<key>match</key>
<string>[&amp;|]</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#typeof-operator</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.type.tsx</string>
<key>match</key>
<string>[&amp;|]</string>
</dict>
</array>
</dict>
<key>type-function-return-type</key>
<dict>
@ -3704,6 +3782,29 @@
</dict>
</array>
</dict>
<dict>
<key>name</key>
<string>meta.object.member.tsx</string>
<key>begin</key>
<string>\.\.\.</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.operator.spread.tsx</string>
</dict>
</dict>
<key>end</key>
<string>(?=,|\})</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#expression</string>
</dict>
</array>
</dict>
<dict>
<key>name</key>
<string>meta.object.member.tsx</string>
@ -3724,7 +3825,7 @@
</dict>
</array>
</dict>
<key>expression-operator</key>
<key>expression-operators</key>
<dict>
<key>patterns</key>
<array>
@ -3795,19 +3896,12 @@
</dict>
</array>
</dict>
</array>
</dict>
<key>typeof-operator</key>
<dict>
<key>name</key>
<string>keyword.operator.typeof.tsx</string>
<key>match</key>
<string>(?&lt;!\.|\$)\btypeof\b(?!\$)</string>
</dict>
<key>operators</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>name</key>
<string>keyword.operator.spread.tsx</string>
<key>match</key>
<string>\.\.\.</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.assignment.compound.tsx</string>
@ -3870,6 +3964,13 @@
</dict>
</array>
</dict>
<key>typeof-operator</key>
<dict>
<key>name</key>
<string>keyword.operator.typeof.tsx</string>
<key>match</key>
<string>(?&lt;!\.|\$)\btypeof\b(?!\$)</string>
</dict>
<key>arrow-function</key>
<dict>
<key>patterns</key>

Просмотреть файл

@ -572,14 +572,10 @@ Grammar: TypeScriptReact.tmLanguage
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.accessor.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.accessor.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.accessor.tsx
^^^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx keyword.operator.spread.tsx
^^^^^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx variable.other.property.tsx
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx variable.other.readwrite.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
^
@ -645,14 +641,10 @@ Grammar: TypeScriptReact.tmLanguage
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.accessor.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.accessor.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.accessor.tsx
^^^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx keyword.operator.spread.tsx
^^^^^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx variable.other.property.tsx
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx variable.other.readwrite.tsx
^
source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
^

Просмотреть файл

@ -194,8 +194,8 @@ Grammar: TypeScriptReact.tmLanguage
[42, 17]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx punctuation.definition.tag.begin.tsx
^^^^^^^^^
[42, 18]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx entity.name.tag.tsx
^
[42, 29]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.accessor.tsx
^^^
[42, 29]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx keyword.operator.spread.tsx
^^
[42, 39]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx punctuation.definition.tag.end.tsx
>
@ -205,8 +205,8 @@ Grammar: TypeScriptReact.tmLanguage
[45, 18]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx punctuation.definition.tag.begin.tsx
^^^^^^^^^
[45, 19]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx entity.name.tag.tsx
^
[45, 30]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx punctuation.accessor.tsx
^^^
[45, 30]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx meta.embedded.expression.tsx keyword.operator.spread.tsx
^^
[45, 57]: source.tsx meta.var.expr.tsx meta.var-single-variable.expr.tsx meta.tag.tsx punctuation.definition.tag.end.tsx
>

Просмотреть файл

@ -0,0 +1,714 @@
original file
-----------------------------------
function foo(...rest) {
}
// rest
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
[a, b, ...rest] = [1, 2, 3, 4, 5];
var { x, ...{ y, z } } = o;
const [x, ...[y, z]] = ['a', 'b', 'c'];
// spread
let n = { x, y, ...z };
function f<T, U>(t: T, u: U): { id: string, ...T, ...U } {
return { id: 'id', ...t, ...u };
}
function myFunction(v, w, x, y, z) { }
var args = [0, 1];
myFunction(-1, ...args, 2, ...[3]);
var parts = ['shoulders', 'knees'];
var lyrics = ['head', ...parts, 'and', 'toes'];
-----------------------------------
Grammar: TypeScript.tmLanguage
-----------------------------------
>function foo(...rest) {
^^^^^^^^
source.ts meta.function.ts storage.type.function.ts
^
source.ts meta.function.ts
^^^
source.ts meta.function.ts entity.name.function.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^^^
source.ts meta.function.ts meta.parameters.ts keyword.operator.rest.ts
^^^^
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.function.ts
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.function.ts meta.block.ts
>}
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>// rest
^^
source.ts comment.line.double-slash.ts punctuation.definition.comment.ts
^^^^^^
source.ts comment.line.double-slash.ts
>let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.definition.binding-pattern.object.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^^^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts keyword.operator.rest.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.definition.binding-pattern.object.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts punctuation.definition.block.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts punctuation.separator.key-value.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts constant.numeric.decimal.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts punctuation.separator.key-value.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts constant.numeric.decimal.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts punctuation.separator.key-value.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts constant.numeric.decimal.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts punctuation.separator.key-value.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts constant.numeric.decimal.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts meta.object.member.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts meta.object-literal.ts punctuation.definition.block.ts
^
source.ts punctuation.terminator.statement.ts
^^
source.ts
>[a, b, ...rest] = [1, 2, 3, 4, 5];
^
source.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.array.literal.ts variable.other.readwrite.ts
^
source.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.array.literal.ts
^
source.ts meta.array.literal.ts variable.other.readwrite.ts
^
source.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.array.literal.ts
^^^
source.ts meta.array.literal.ts keyword.operator.spread.ts
^^^^
source.ts meta.array.literal.ts variable.other.readwrite.ts
^
source.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts
^
source.ts keyword.operator.assignment.ts
^
source.ts
^
source.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.array.literal.ts constant.numeric.decimal.ts
^
source.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.array.literal.ts
^
source.ts meta.array.literal.ts constant.numeric.decimal.ts
^
source.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.array.literal.ts
^
source.ts meta.array.literal.ts constant.numeric.decimal.ts
^
source.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.array.literal.ts
^
source.ts meta.array.literal.ts constant.numeric.decimal.ts
^
source.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.array.literal.ts
^
source.ts meta.array.literal.ts constant.numeric.decimal.ts
^
source.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts punctuation.terminator.statement.ts
^^
source.ts
>var { x, ...{ y, z } } = o;
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.definition.binding-pattern.object.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^^^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts keyword.operator.rest.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.definition.binding-pattern.object.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.definition.binding-pattern.object.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts punctuation.definition.binding-pattern.object.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.object-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts punctuation.terminator.statement.ts
^^
source.ts
>const [x, ...[y, z]] = ['a', 'b', 'c'];
^^^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts punctuation.definition.binding-pattern.array.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts
^^^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts keyword.operator.rest.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts punctuation.definition.binding-pattern.array.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts punctuation.definition.binding-pattern.array.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts punctuation.definition.binding-pattern.array.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.array-binding-pattern-variable.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts punctuation.terminator.statement.ts
^^
source.ts
>// spread
^^
source.ts comment.line.double-slash.ts punctuation.definition.comment.ts
^^^^^^^^
source.ts comment.line.double-slash.ts
>let n = { x, y, ...z };
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts punctuation.definition.block.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts meta.object.member.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts meta.object.member.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts
^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts meta.object.member.ts keyword.operator.spread.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts meta.object.member.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts meta.object.member.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.object-literal.ts punctuation.definition.block.ts
^
source.ts punctuation.terminator.statement.ts
^^
source.ts
>function f<T, U>(t: T, u: U): { id: string, ...T, ...U } {
^^^^^^^^
source.ts meta.function.ts storage.type.function.ts
^
source.ts meta.function.ts
^
source.ts meta.function.ts entity.name.function.ts
^
source.ts meta.function.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^
source.ts meta.function.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.function.ts meta.type.parameters.ts punctuation.separator.comma.ts
^
source.ts meta.function.ts meta.type.parameters.ts
^
source.ts meta.function.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.function.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts entity.name.type.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.separator.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts
^
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts entity.name.type.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.function.ts meta.return.type.ts keyword.operator.type.annotation.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts punctuation.definition.block.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts meta.field.declaration.ts
^^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts meta.field.declaration.ts variable.object.property.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts keyword.operator.type.annotation.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts
^^^^^^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts meta.field.declaration.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts punctuation.separator.comma.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts
^^^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts keyword.operator.spread.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts entity.name.type.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts punctuation.separator.comma.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts
^^^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts keyword.operator.spread.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts entity.name.type.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts
^
source.ts meta.function.ts meta.return.type.ts meta.object.type.ts punctuation.definition.block.ts
^
source.ts meta.function.ts meta.return.type.ts
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.function.ts meta.block.ts
> return { id: 'id', ...t, ...u };
^^^^
source.ts meta.function.ts meta.block.ts
^^^^^^
source.ts meta.function.ts meta.block.ts keyword.control.flow.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts punctuation.definition.block.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts
^^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts meta.object-literal.key.ts punctuation.separator.key-value.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts string.quoted.single.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts punctuation.separator.comma.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts
^^^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts keyword.operator.spread.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts variable.other.readwrite.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts punctuation.separator.comma.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts
^^^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts keyword.operator.spread.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts variable.other.readwrite.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts meta.object.member.ts
^
source.ts meta.function.ts meta.block.ts meta.object-literal.ts punctuation.definition.block.ts
^
source.ts meta.function.ts meta.block.ts punctuation.terminator.statement.ts
^^
source.ts meta.function.ts meta.block.ts
>}
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>function myFunction(v, w, x, y, z) { }
^^^^^^^^
source.ts meta.function.ts storage.type.function.ts
^
source.ts meta.function.ts
^^^^^^^^^^
source.ts meta.function.ts entity.name.function.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.separator.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts
^
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.separator.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts
^
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.separator.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts
^
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.separator.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts
^
source.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.function.ts
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.function.ts meta.block.ts
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>var args = [0, 1];
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts constant.numeric.decimal.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts constant.numeric.decimal.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts punctuation.terminator.statement.ts
^^
source.ts
>myFunction(-1, ...args, 2, ...[3]);
^^^^^^^^^^
source.ts entity.name.function.ts
^
source.ts meta.brace.round.ts
^
source.ts keyword.operator.arithmetic.ts
^
source.ts constant.numeric.decimal.ts
^
source.ts punctuation.separator.comma.ts
^
source.ts
^^^
source.ts keyword.operator.spread.ts
^^^^
source.ts variable.other.readwrite.ts
^
source.ts punctuation.separator.comma.ts
^
source.ts
^
source.ts constant.numeric.decimal.ts
^
source.ts punctuation.separator.comma.ts
^
source.ts
^^^
source.ts keyword.operator.spread.ts
^
source.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.array.literal.ts constant.numeric.decimal.ts
^
source.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.brace.round.ts
^
source.ts punctuation.terminator.statement.ts
^^
source.ts
>var parts = ['shoulders', 'knees'];
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts punctuation.terminator.statement.ts
^^
source.ts
>var lyrics = ['head', ...parts, 'and', 'toes'];
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts
^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts keyword.operator.spread.ts
^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts punctuation.separator.comma.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts punctuation.terminator.statement.ts

Просмотреть файл

@ -0,0 +1,17 @@
function foo(...rest) {
}
// rest
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
[a, b, ...rest] = [1, 2, 3, 4, 5];
var { x, ...{ y, z } } = o;
const [x, ...[y, z]] = ['a', 'b', 'c'];
// spread
let n = { x, y, ...z };
function f<T, U>(t: T, u: U): { id: string, ...T, ...U } {
return { id: 'id', ...t, ...u };
}
function myFunction(v, w, x, y, z) { }
var args = [0, 1];
myFunction(-1, ...args, 2, ...[3]);
var parts = ['shoulders', 'knees'];
var lyrics = ['head', ...parts, 'and', 'toes'];