Support generators syntax and fix the scoping of type parameter end

This commit is contained in:
Sheetal Nandi 2016-08-31 11:21:34 -07:00
Родитель 82ac7df371
Коммит f01053fb79
16 изменённых файлов: 750 добавлений и 80 удалений

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

@ -185,7 +185,11 @@ repository:
- name: keyword.control.loop.ts
match: (?<!\.)\b(break|continue|do|goto|while)\b
- name: keyword.control.flow.ts
match: (?<!\.)\b(await|return|yield)\b
match: (?<!\.)\b(await|return)\b
- match: (?<!\.)\b(yield)\b(?:\s*(\*))?
captures:
'1': { name: keyword.control.flow.ts }
'2': { name: keyword.generator.asterisk.ts }
- name: keyword.control.switch.ts
match: (?<!\.)\b(case|default|switch)\b
- name: keyword.control.conditional.ts
@ -472,7 +476,7 @@ repository:
method-declaration:
name: meta.method.declaration.ts
begin: (?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|(((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\<])
begin: (?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|((?:(\*)\s*)?((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\<])
beginCaptures:
'1': { name: storage.modifier.ts } # captures keyword (abstract)
'2': { name: storage.modifier.ts } # captures keyword (public or private or protected)
@ -490,7 +494,7 @@ repository:
method-overload-declaration:
name: meta.method.overload.declaration.ts
begin: (?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|(((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\<])
begin: (?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|((?:(\*)\s*)?((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\<])
beginCaptures:
'1': { name: storage.modifier.ts } # captures keyword (abstract)
'2': { name: storage.modifier.ts } # captures keyword (public or private or protected)
@ -504,6 +508,9 @@ repository:
begin: \G
end: (?=\(|\<)
patterns:
- match: (\*)\s*
captures:
'1': { name: keyword.generator.asterisk.ts }
- include: '#string'
- include: '#array-literal'
- name: keyword.operator.new.ts
@ -536,12 +543,13 @@ repository:
function-declaration:
name: meta.function.ts
begin: \b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s+([_$[:alpha:]][_$[:alnum:]]*))?\s*
begin: \b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*
beginCaptures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.modifier.async.ts }
'3': { name: storage.type.function.ts }
'4': { name: entity.name.function.ts }
'4': { name: keyword.generator.asterisk.ts }
'5': { name: entity.name.function.ts }
end: (?=;|\})|(?<=\})
patterns:
- include: '#comment'
@ -553,11 +561,13 @@ repository:
function-overload-declaration:
name: meta.function.overload.ts
match: \b(?:(export)\s+)?(function\b)(?:\s+([_$[:alpha:]][_$[:alnum:]]*))?\s*
match: \b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*
captures:
'1': { name: keyword.control.export.ts }
'2': { name: storage.type.function.ts }
'3': { name: entity.name.function.ts }
'2': { name: storage.modifier.async.ts }
'3': { name: storage.type.function.ts }
'4': { name: keyword.generator.asterisk.ts }
'5': { name: entity.name.function.ts }
object-literal:
name: meta.object-literal.ts
@ -583,7 +593,7 @@ repository:
after-operator-block:
name: meta.object-literal.ts
begin: (?<=[=(:,\[?+!]|^|await|return|yield|throw|in|of|typeof|&&|\|\|)\s*(\{)
begin: (?<=[=(:,\[?+!]|^|await|return|yield|throw|in|of|typeof|&&|\|\||\*)\s*(\{)
beginCaptures:
'1': { name: punctuation.definition.block.ts }
end: \}
@ -798,7 +808,7 @@ repository:
'2': { name: punctuation.definition.typeparameters.begin.ts }
end: '(?=$)|(>)'
endCaptures:
'2': { name: punctuation.definition.typeparameters.end.ts }
'1': { name: punctuation.definition.typeparameters.end.ts }
patterns:
- name: storage.modifier.ts
match: '\b(extends)\b'
@ -887,7 +897,7 @@ repository:
# If '<' is preceeded by 'return', 'throw', 'yield', or 'await', it's most likely a type assertion
# If '=', '(', ',', ':', or '>' are followed by a '<', it is also likely a type assertion as otherwise it would be a syntax error
# '<=' and '<<=' are cannot be type assertions, as they are assignment operators.
begin: '(?:(?<=return|throw|yield|await|[=(,:>]))\s*(<)(?!<?\=)'
begin: '(?:(?<=return|throw|yield|await|[=(,:>*]))\s*(<)(?!<?\=)'
beginCaptures:
'1': { name: meta.brace.angle.ts }
end: '>'
@ -974,7 +984,7 @@ repository:
captures:
'1': { name: variable.parameter.ts }
- name: meta.arrow.ts
begin: (?x)(?<=return|throw|yield|await|async|[=(,:>])\s*(?=\(([^()]+|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>)
begin: (?x)(?<=return|throw|yield|await|async|[=(,:>*])\s*(?=\(([^()]+|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>)
end: (?==>)
patterns:
- include: '#function-parameters'

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

@ -27,7 +27,7 @@
<key>after-operator-block</key>
<dict>
<key>begin</key>
<string>(?&lt;=[=(:,\[?+!]|^|await|return|yield|throw|in|of|typeof|&amp;&amp;|\|\|)\s*(\{)</string>
<string>(?&lt;=[=(:,\[?+!]|^|await|return|yield|throw|in|of|typeof|&amp;&amp;|\|\||\*)\s*(\{)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -182,7 +182,7 @@
</dict>
<dict>
<key>begin</key>
<string>(?x)(?&lt;=return|throw|yield|await|async|[=(,:&gt;])\s*(?=\(([^()]+|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=&gt;)</string>
<string>(?x)(?&lt;=return|throw|yield|await|async|[=(,:&gt;*])\s*(?=\(([^()]+|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=&gt;)</string>
<key>end</key>
<string>(?==&gt;)</string>
<key>name</key>
@ -289,7 +289,7 @@
<key>cast</key>
<dict>
<key>begin</key>
<string>(?:(?&lt;=return|throw|yield|await|[=(,:&gt;]))\s*(&lt;)(?!&lt;?\=)</string>
<string>(?:(?&lt;=return|throw|yield|await|[=(,:&gt;*]))\s*(&lt;)(?!&lt;?\=)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -623,10 +623,27 @@
</dict>
<dict>
<key>match</key>
<string>(?&lt;!\.)\b(await|return|yield)\b</string>
<string>(?&lt;!\.)\b(await|return)\b</string>
<key>name</key>
<string>keyword.control.flow.ts</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.control.flow.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.ts</string>
</dict>
</dict>
<key>match</key>
<string>(?&lt;!\.)\b(yield)\b(?:\s*(\*))?</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;!\.)\b(case|default|switch)\b</string>
@ -1387,7 +1404,7 @@
<key>function-declaration</key>
<dict>
<key>begin</key>
<string>\b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s+([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<string>\b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?&lt;=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -1406,6 +1423,11 @@
<string>storage.type.function.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.ts</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.function.ts</string>
@ -1455,16 +1477,26 @@
<key>2</key>
<dict>
<key>name</key>
<string>storage.type.function.ts</string>
<string>storage.modifier.async.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.function.ts</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.ts</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.function.ts</string>
</dict>
</dict>
<key>match</key>
<string>\b(?:(export)\s+)?(function\b)(?:\s+([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<string>\b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?&lt;=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<key>name</key>
<string>meta.function.overload.ts</string>
</dict>
@ -1908,7 +1940,7 @@
<key>method-declaration</key>
<dict>
<key>begin</key>
<string>(?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|(((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\&lt;])</string>
<string>(?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|((?:(\*)\s*)?((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\&lt;])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -1976,6 +2008,18 @@
<string>(?=\(|\&lt;)</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.ts</string>
</dict>
</dict>
<key>match</key>
<string>(\*)\s*</string>
</dict>
<dict>
<key>include</key>
<string>#string</string>
@ -2013,7 +2057,7 @@
<key>method-overload-declaration</key>
<dict>
<key>begin</key>
<string>(?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|(((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\&lt;])</string>
<string>(?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|((?:(\*)\s*)?((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\&lt;])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -3632,7 +3676,7 @@
<string>(?=$)|(&gt;)</string>
<key>endCaptures</key>
<dict>
<key>2</key>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.typeparameters.end.ts</string>

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

@ -189,7 +189,11 @@ repository:
- name: keyword.control.loop.tsx
match: (?<!\.)\b(break|continue|do|goto|while)\b
- name: keyword.control.flow.tsx
match: (?<!\.)\b(await|return|yield)\b
match: (?<!\.)\b(await|return)\b
- match: (?<!\.)\b(yield)\b(?:\s*(\*))?
captures:
'1': { name: keyword.control.flow.tsx }
'2': { name: keyword.generator.asterisk.tsx }
- name: keyword.control.switch.tsx
match: (?<!\.)\b(case|default|switch)\b
- name: keyword.control.conditional.tsx
@ -476,7 +480,7 @@ repository:
method-declaration:
name: meta.method.declaration.tsx
begin: (?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|(((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\<])
begin: (?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|((?:(\*)\s*)?((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\<])
beginCaptures:
'1': { name: storage.modifier.tsx } # captures keyword (abstract)
'2': { name: storage.modifier.tsx } # captures keyword (public or private or protected)
@ -494,7 +498,7 @@ repository:
method-overload-declaration:
name: meta.method.overload.declaration.tsx
begin: (?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|(((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\<])
begin: (?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|((?:(\*)\s*)?((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\<])
beginCaptures:
'1': { name: storage.modifier.tsx } # captures keyword (abstract)
'2': { name: storage.modifier.tsx } # captures keyword (public or private or protected)
@ -508,6 +512,9 @@ repository:
begin: \G
end: (?=\(|\<)
patterns:
- match: (\*)\s*
captures:
'1': { name: keyword.generator.asterisk.tsx }
- include: '#string'
- include: '#array-literal'
- name: keyword.operator.new.tsx
@ -540,12 +547,13 @@ repository:
function-declaration:
name: meta.function.tsx
begin: \b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s+([_$[:alpha:]][_$[:alnum:]]*))?\s*
begin: \b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*
beginCaptures:
'1': { name: keyword.control.export.tsx }
'2': { name: storage.modifier.async.tsx }
'3': { name: storage.type.function.tsx }
'4': { name: entity.name.function.tsx }
'4': { name: keyword.generator.asterisk.tsx }
'5': { name: entity.name.function.ts }
end: (?=;|\})|(?<=\})
patterns:
- include: '#comment'
@ -557,11 +565,13 @@ repository:
function-overload-declaration:
name: meta.function.overload.tsx
match: \b(?:(export)\s+)?(function\b)(?:\s+([_$[:alpha:]][_$[:alnum:]]*))?\s*
match: \b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*
captures:
'1': { name: keyword.control.export.tsx }
'2': { name: storage.type.function.tsx }
'3': { name: entity.name.function.tsx }
'2': { name: storage.modifier.async.tsx }
'3': { name: storage.type.function.tsx }
'4': { name: keyword.generator.asterisk.tsx }
'5': { name: entity.name.function.tsx }
object-literal:
name: meta.object-literal.tsx
@ -587,7 +597,7 @@ repository:
after-operator-block:
name: meta.object-literal.tsx
begin: (?<=[=(:,\[?+!]|^|await|return|yield|throw|in|of|typeof|&&|\|\|)\s*(\{)
begin: (?<=[=(:,\[?+!]|^|await|return|yield|throw|in|of|typeof|&&|\|\||\*)\s*(\{)
beginCaptures:
'1': { name: punctuation.definition.block.tsx }
end: \}
@ -802,7 +812,7 @@ repository:
'2': { name: punctuation.definition.typeparameters.begin.tsx }
end: '(?=$)|(>)'
endCaptures:
'2': { name: punctuation.definition.typeparameters.end.tsx }
'1': { name: punctuation.definition.typeparameters.end.tsx }
patterns:
- name: storage.modifier.tsx
match: '\b(extends)\b'
@ -964,7 +974,7 @@ repository:
captures:
'1': { name: variable.parameter.tsx }
- name: meta.arrow.tsx
begin: (?x)(?<=return|throw|yield|await|async|[=(,:>])\s*(?=\(([^()]+|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>)
begin: (?x)(?<=return|throw|yield|await|async|[=(,:>*])\s*(?=\(([^()]+|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>)
end: (?==>)
patterns:
- include: '#function-parameters'

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

@ -27,7 +27,7 @@
<key>after-operator-block</key>
<dict>
<key>begin</key>
<string>(?&lt;=[=(:,\[?+!]|^|await|return|yield|throw|in|of|typeof|&amp;&amp;|\|\|)\s*(\{)</string>
<string>(?&lt;=[=(:,\[?+!]|^|await|return|yield|throw|in|of|typeof|&amp;&amp;|\|\||\*)\s*(\{)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -182,7 +182,7 @@
</dict>
<dict>
<key>begin</key>
<string>(?x)(?&lt;=return|throw|yield|await|async|[=(,:&gt;])\s*(?=\(([^()]+|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=&gt;)</string>
<string>(?x)(?&lt;=return|throw|yield|await|async|[=(,:&gt;*])\s*(?=\(([^()]+|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=&gt;)</string>
<key>end</key>
<string>(?==&gt;)</string>
<key>name</key>
@ -591,10 +591,27 @@
</dict>
<dict>
<key>match</key>
<string>(?&lt;!\.)\b(await|return|yield)\b</string>
<string>(?&lt;!\.)\b(await|return)\b</string>
<key>name</key>
<string>keyword.control.flow.tsx</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.control.flow.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.tsx</string>
</dict>
</dict>
<key>match</key>
<string>(?&lt;!\.)\b(yield)\b(?:\s*(\*))?</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;!\.)\b(case|default|switch)\b</string>
@ -1355,7 +1372,7 @@
<key>function-declaration</key>
<dict>
<key>begin</key>
<string>\b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s+([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<string>\b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?&lt;=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -1376,7 +1393,12 @@
<key>4</key>
<dict>
<key>name</key>
<string>entity.name.function.tsx</string>
<string>keyword.generator.asterisk.tsx</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.function.ts</string>
</dict>
</dict>
<key>end</key>
@ -1423,16 +1445,26 @@
<key>2</key>
<dict>
<key>name</key>
<string>storage.type.function.tsx</string>
<string>storage.modifier.async.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>storage.type.function.tsx</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.tsx</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.function.tsx</string>
</dict>
</dict>
<key>match</key>
<string>\b(?:(export)\s+)?(function\b)(?:\s+([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<string>\b(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?&lt;=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*</string>
<key>name</key>
<string>meta.function.overload.tsx</string>
</dict>
@ -2305,7 +2337,7 @@
<key>method-declaration</key>
<dict>
<key>begin</key>
<string>(?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|(((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\&lt;])</string>
<string>(?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|((?:(\*)\s*)?((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\&lt;])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -2373,6 +2405,18 @@
<string>(?=\(|\&lt;)</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.generator.asterisk.tsx</string>
</dict>
</dict>
<key>match</key>
<string>(\*)\s*</string>
</dict>
<dict>
<key>include</key>
<string>#string</string>
@ -2410,7 +2454,7 @@
<key>method-overload-declaration</key>
<dict>
<key>begin</key>
<string>(?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|(((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\&lt;])</string>
<string>(?:\b(abstract)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?=((\bnew)|(?:\b(constructor)\b)|((?:(\*)\s*)?((?:\b[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(?:\[[^\]]*\]))\s*(\??)))?\s*[\(\&lt;])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@ -4033,7 +4077,7 @@
<string>(?=$)|(&gt;)</string>
<key>endCaptures</key>
<dict>
<key>2</key>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.typeparameters.end.tsx</string>

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

@ -1417,7 +1417,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts
^^^^^^^
@ -1439,7 +1439,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts
^
@ -1480,7 +1480,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^^
source.ts meta.declaration.object.ts comment.block.ts punctuation.definition.comment.ts
^^
@ -1504,7 +1504,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts
^
@ -1545,7 +1545,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts
^^^^^^^
@ -1569,7 +1569,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts
^
@ -1610,7 +1610,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts
^^^^^^^
@ -1636,7 +1636,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts
^
@ -1677,7 +1677,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts
^^^^^^^
@ -1699,7 +1699,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.heritage.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^^
source.ts meta.declaration.object.ts meta.object.heritage.ts comment.block.ts punctuation.definition.comment.ts
^^
@ -1757,7 +1757,7 @@ var x = new ^^/* comments */ String();
^^^^^^^^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts
^
@ -1780,7 +1780,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
@ -1830,7 +1830,7 @@ var x = new ^^/* comments */ String();
^^^^^^^^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts
^
@ -1853,7 +1853,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
@ -1903,7 +1903,7 @@ var x = new ^^/* comments */ String();
^^^^^^^^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts
^
@ -1926,7 +1926,7 @@ var x = new ^^/* comments */ String();
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^

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

@ -219,7 +219,7 @@ class testClass {
^^^^^^
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts meta.type.parameters.ts
source.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^^
source.ts meta.function.ts meta.parameters.ts
> m8: [number, number],
@ -557,7 +557,7 @@ class testClass {
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts
> m8: [number, number],

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

@ -308,7 +308,7 @@ class TestClass {
^
source.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts
source.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.function.ts meta.return.type.ts
^
@ -1170,7 +1170,7 @@ class TestClass {
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
^

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

@ -0,0 +1,110 @@
original file
-----------------------------------
function foo() {
return 'bar';
}
function* foo() {
yield 'bar';
yield* ['bar'];
}
-----------------------------------
>function foo() {
^^^^^^^^
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 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
> return 'bar';
^^^^
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
^
source.ts meta.function.ts meta.block.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^
source.ts meta.function.ts meta.block.ts string.quoted.single.ts
^
source.ts meta.function.ts meta.block.ts string.quoted.single.ts punctuation.definition.string.end.ts
^^^
source.ts meta.function.ts meta.block.ts
>}
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>
^^
source.ts
>function* foo() {
^^^^^^^^
source.ts meta.function.ts storage.type.function.ts
^
source.ts meta.function.ts keyword.generator.asterisk.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 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
> yield 'bar';
^^^^
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
^
source.ts meta.function.ts meta.block.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^
source.ts meta.function.ts meta.block.ts string.quoted.single.ts
^
source.ts meta.function.ts meta.block.ts string.quoted.single.ts punctuation.definition.string.end.ts
^^^
source.ts meta.function.ts meta.block.ts
> yield* ['bar'];
^^^^
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 keyword.generator.asterisk.ts
^
source.ts meta.function.ts meta.block.ts
^
source.ts meta.function.ts meta.block.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.function.ts meta.block.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^
source.ts meta.function.ts meta.block.ts meta.array.literal.ts string.quoted.single.ts
^
source.ts meta.function.ts meta.block.ts meta.array.literal.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.function.ts meta.block.ts meta.array.literal.ts meta.brace.square.ts
^^^
source.ts meta.function.ts meta.block.ts
>}
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts

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

@ -78,7 +78,7 @@ class Thing<^^T, ^^U> {
^^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.brace.round.ts
^
@ -204,7 +204,7 @@ class Thing<^^T, ^^U> {
^
source.ts meta.declaration.object.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts
^
@ -254,7 +254,7 @@ class Thing<^^T, ^^U> {
^^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.brace.round.ts
^

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

@ -40,7 +40,7 @@ class MyClass {
^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts new.expr.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts new.expr.ts meta.type.parameters.ts
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts new.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.brace.round.ts
^
@ -77,7 +77,7 @@ class MyClass {
^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.brace.round.ts
^
@ -134,7 +134,7 @@ class MyClass {
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts new.expr.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts new.expr.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts new.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.brace.round.ts
^
@ -173,7 +173,7 @@ class MyClass {
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.brace.round.ts
^
@ -215,7 +215,7 @@ class MyClass {
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts new.expr.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts new.expr.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts new.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.brace.round.ts
^
@ -250,7 +250,7 @@ class MyClass {
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.type.parameters.ts
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.field.declaration.ts meta.brace.round.ts
^

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

@ -30,7 +30,7 @@ type Callback = ^^(error: Error, value: T) => ^^any
^
source.ts meta.type.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.type.declaration.ts meta.type.parameters.ts
source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.type.declaration.ts
^^
@ -78,7 +78,7 @@ type Callback = ^^(error: Error, value: T) => ^^any
^
source.ts meta.type.declaration.ts meta.type.parameters.ts
^
source.ts meta.type.declaration.ts meta.type.parameters.ts
source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.type.declaration.ts
^^
@ -196,7 +196,7 @@ type Callback = ^^(error: Error, value: T) => ^^any
^^^^
source.ts meta.type.declaration.ts meta.type.parameters.ts meta.type.function.return.ts support.type.primitive.ts
^
source.ts meta.type.declaration.ts meta.type.parameters.ts
source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.type.declaration.ts
^^
@ -248,7 +248,7 @@ type Callback = ^^(error: Error, value: T) => ^^any
^
source.ts meta.type.declaration.ts meta.type.parameters.ts
^
source.ts meta.type.declaration.ts meta.type.parameters.ts
source.ts meta.type.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.type.declaration.ts
^^

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

@ -83,7 +83,7 @@ var e = <div data-custom-attribute="^^foo" />
^^^^^
source.tsx meta.declaration.object.tsx meta.object.heritage.tsx meta.type.parameters.tsx entity.name.type.tsx
^
source.tsx meta.declaration.object.tsx meta.object.heritage.tsx meta.type.parameters.tsx
source.tsx meta.declaration.object.tsx meta.object.heritage.tsx meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx
^
source.tsx meta.declaration.object.tsx meta.object.body.tsx punctuation.definition.block.tsx
> render() {

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

@ -0,0 +1,424 @@
original file
-----------------------------------
module M {
function* f(s: string): Iterable<any>
function* f(s: number): Iterable<any>
function* f(s: any): Iterable<any> { }
}
const a = 10, b = 10;
class c {
*method() {
}
*[a*b]() {
}
*'some*string'() {
}
* overload(s: string): string
* overload(n: number): number
* overload<T extends (string | number)>(sn: T): T {
return sn;
}
}
-----------------------------------
>module M {
^^^^^^
source.ts meta.namespace.declaration.ts storage.type.namespace.ts
^
source.ts meta.namespace.declaration.ts
^
source.ts meta.namespace.declaration.ts entity.name.type.module.ts
^
source.ts meta.namespace.declaration.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.block.ts
> function* f(s: string): Iterable<any>
^^^^
source.ts meta.block.ts
^^^^^^^^
source.ts meta.block.ts meta.function.ts storage.type.function.ts
^
source.ts meta.block.ts meta.function.ts keyword.generator.asterisk.ts
^
source.ts meta.block.ts meta.function.ts
^
source.ts meta.block.ts meta.function.ts entity.name.function.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts
^^^^^^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
^^^^^^^^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^^^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
> function* f(s: number): Iterable<any>
^^^^
source.ts meta.block.ts meta.function.ts
^^^^^^^^
source.ts meta.block.ts meta.function.ts meta.function.overload.ts storage.type.function.ts
^
source.ts meta.block.ts meta.function.ts meta.function.overload.ts keyword.generator.asterisk.ts
^
source.ts meta.block.ts meta.function.ts meta.function.overload.ts
^
source.ts meta.block.ts meta.function.ts meta.function.overload.ts entity.name.function.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts
^^^^^^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
^^^^^^^^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^^^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
> function* f(s: any): Iterable<any> { }
^^^^
source.ts meta.block.ts meta.function.ts
^^^^^^^^
source.ts meta.block.ts meta.function.ts meta.function.overload.ts storage.type.function.ts
^
source.ts meta.block.ts meta.function.ts meta.function.overload.ts keyword.generator.asterisk.ts
^
source.ts meta.block.ts meta.function.ts meta.function.overload.ts
^
source.ts meta.block.ts meta.function.ts meta.function.overload.ts entity.name.function.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts
^^^
source.ts meta.block.ts meta.function.ts meta.parameters.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.block.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
^^^^^^^^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^^^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.block.ts meta.function.ts meta.return.type.ts
^
source.ts meta.block.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.block.ts meta.function.ts meta.block.ts
^
source.ts meta.block.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.block.ts
>}
^
source.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>
^^
source.ts
>const a = 10, b = 10;
^^^^^
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 constant.numeric.decimal.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 constant.numeric.decimal.ts
^^^
source.ts
>class c {
^^^^^
source.ts meta.declaration.object.ts storage.type.class.ts
^
source.ts meta.declaration.object.ts
^
source.ts meta.declaration.object.ts meta.object.name.ts entity.name.class.ts
^
source.ts meta.declaration.object.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts
> *method() {
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts keyword.generator.asterisk.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts entity.name.function.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
> }
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts
> *[a*b]() {
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts keyword.generator.asterisk.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.array.literal.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.array.literal.ts keyword.operator.arithmetic.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.array.literal.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.array.literal.ts meta.brace.square.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
> }
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts
> *'some*string'() {
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts keyword.generator.asterisk.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^^^^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts string.quoted.single.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
> }
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts
> * overload(s: string): string
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts keyword.generator.asterisk.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts
^^^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts entity.name.function.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
> * overload(n: number): number
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.method.overload.declaration.ts keyword.generator.asterisk.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.method.overload.declaration.ts
^^^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.method.overload.declaration.ts entity.name.function.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
> * overload<T extends (string | number)>(sn: T): T {
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.method.overload.declaration.ts keyword.generator.asterisk.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.method.overload.declaration.ts
^^^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.method.overload.declaration.ts entity.name.function.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts
^^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts storage.modifier.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.paren.cover.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.paren.cover.ts meta.brace.round.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.paren.cover.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.paren.cover.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.paren.cover.ts keyword.operator.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.paren.cover.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.paren.cover.ts support.type.primitive.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts meta.type.paren.cover.ts meta.brace.round.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts variable.parameter.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts meta.type.annotation.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts entity.name.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.return.type.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
> return sn;
^^^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts keyword.control.flow.ts
^^^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
> }
^^^^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts
^
source.ts meta.declaration.object.ts meta.object.body.ts meta.method.declaration.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts meta.declaration.object.ts meta.object.body.ts
>}
^
source.ts meta.declaration.object.ts meta.object.body.ts punctuation.definition.block.ts

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

@ -205,7 +205,7 @@ class Test {
^^^^^^^
source.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts
source.ts meta.function.ts meta.return.type.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.function.ts meta.return.type.ts
^
@ -300,7 +300,7 @@ class Test {
^^^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.brace.round.ts
^^^^^^^^^^^
@ -347,7 +347,7 @@ class Test {
^^^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts support.type.primitive.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.brace.round.ts
^^^^^^^^^^^^

8
tests/cases/Issue146.ts Normal file
Просмотреть файл

@ -0,0 +1,8 @@
function foo() {
return 'bar';
}
function* foo() {
yield 'bar';
yield* ['bar'];
}

20
tests/cases/generator.ts Normal file
Просмотреть файл

@ -0,0 +1,20 @@
module M {
function* f(s: string): Iterable<any>
function* f(s: number): Iterable<any>
function* f(s: any): Iterable<any> { }
}
const a = 10, b = 10;
class c {
*method() {
}
*[a*b]() {
}
*'some*string'() {
}
* overload(s: string): string
* overload(n: number): number
* overload<T extends (string | number)>(sn: T): T {
return sn;
}
}