Fixes #572
This commit is contained in:
Sheetal Nandi 2018-03-02 14:00:42 -08:00
Родитель d472fd3379
Коммит ebd19c7673
5 изменённых файлов: 587 добавлений и 64 удалений

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

@ -965,18 +965,24 @@ repository:
- include: '#statements'
for-loop:
begin: '{{startOfIdentifier}}(for)(?:\s+(await))?\s*(\()'
begin: '{{startOfIdentifier}}for(?=((\s+|(\s*{{inlineComment}}\s*))await)?\s*({{inlineComment}}\s*)?(\())'
beginCaptures:
'1': { name: keyword.control.loop.ts }
'2': { name: keyword.control.loop.ts }
'3': { name: meta.brace.round.ts }
end: \)
endCaptures:
'0': { name: meta.brace.round.ts }
'0': { name: keyword.control.loop.ts }
end: (?<=\))
patterns:
- include: '#var-expr'
- include: '#expression'
- include: '#punctuation-semicolon'
- include: '#comment'
- name: keyword.control.loop.ts
match: await
- begin: \(
beginCaptures:
'0': { name: meta.brace.round.ts }
end: \)
endCaptures:
'0': { name: meta.brace.round.ts }
patterns:
- include: '#var-expr'
- include: '#expression'
- include: '#punctuation-semicolon'
#blocks
decl-block:

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

@ -3015,48 +3015,65 @@
<key>for-loop</key>
<dict>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(for)(?:\s+(await))?\s*(\()</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))for(?=((\s+|(\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*))await)?\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)?(\())</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.control.loop.ts</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.control.loop.ts</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>meta.brace.round.ts</string>
</dict>
</dict>
<key>end</key>
<string>\)</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>meta.brace.round.ts</string>
<string>keyword.control.loop.ts</string>
</dict>
</dict>
<key>end</key>
<string>(?&lt;=\))</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#var-expr</string>
<string>#comment</string>
</dict>
<dict>
<key>include</key>
<string>#expression</string>
<key>name</key>
<string>keyword.control.loop.ts</string>
<key>match</key>
<string>await</string>
</dict>
<dict>
<key>include</key>
<string>#punctuation-semicolon</string>
<key>begin</key>
<string>\(</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>meta.brace.round.ts</string>
</dict>
</dict>
<key>end</key>
<string>\)</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>meta.brace.round.ts</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#var-expr</string>
</dict>
<dict>
<key>include</key>
<string>#expression</string>
</dict>
<dict>
<key>include</key>
<string>#punctuation-semicolon</string>
</dict>
</array>
</dict>
</array>
</dict>

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

@ -3019,48 +3019,65 @@
<key>for-loop</key>
<dict>
<key>begin</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))(for)(?:\s+(await))?\s*(\()</string>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))for(?=((\s+|(\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*))await)?\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)?(\())</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.control.loop.tsx</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.control.loop.tsx</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>meta.brace.round.tsx</string>
</dict>
</dict>
<key>end</key>
<string>\)</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>meta.brace.round.tsx</string>
<string>keyword.control.loop.tsx</string>
</dict>
</dict>
<key>end</key>
<string>(?&lt;=\))</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#var-expr</string>
<string>#comment</string>
</dict>
<dict>
<key>include</key>
<string>#expression</string>
<key>name</key>
<string>keyword.control.loop.tsx</string>
<key>match</key>
<string>await</string>
</dict>
<dict>
<key>include</key>
<string>#punctuation-semicolon</string>
<key>begin</key>
<string>\(</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>meta.brace.round.tsx</string>
</dict>
</dict>
<key>end</key>
<string>\)</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>meta.brace.round.tsx</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#var-expr</string>
</dict>
<dict>
<key>include</key>
<string>#expression</string>
</dict>
<dict>
<key>include</key>
<string>#punctuation-semicolon</string>
</dict>
</array>
</dict>
</array>
</dict>

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

@ -0,0 +1,478 @@
original file
-----------------------------------
/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/{}
/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ of /*5*/ a /*6*/) /*7*/{}
/*0*/ for /*1*/ ( /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/ {}
/*0*/ for /*1*/ ( /*3*/ x /*4*/ of /*5*/ a /*6*/) /*7*/ {}
/*0*/ for /*1*/ ( /*2*/ a /*3*/ ; /*4*/ a /*5*/ ; /*6*/ a /*7*/) /*8*/ {}
-----------------------------------
Grammar: TypeScript.tmLanguage
-----------------------------------
>/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/{}
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^^
source.ts keyword.control.loop.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^
source.ts meta.var.expr.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.var.expr.ts comment.block.ts
^^
source.ts meta.var.expr.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts comment.block.ts
^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^
source.ts keyword.operator.expression.in.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ of /*5*/ a /*6*/) /*7*/{}
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^^
source.ts keyword.control.loop.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^^
source.ts meta.var.expr.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.var.expr.ts comment.block.ts
^^
source.ts meta.var.expr.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts comment.block.ts
^^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^
source.ts keyword.operator.expression.of.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>/*0*/ for /*1*/ ( /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/ {}
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^^
source.ts keyword.control.loop.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^
source.ts keyword.operator.expression.in.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>/*0*/ for /*1*/ ( /*3*/ x /*4*/ of /*5*/ a /*6*/) /*7*/ {}
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^^
source.ts keyword.control.loop.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^
source.ts keyword.operator.expression.of.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^^
source.ts
>/*0*/ for /*1*/ ( /*2*/ a /*3*/ ; /*4*/ a /*5*/ ; /*6*/ a /*7*/) /*8*/ {}
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^^^
source.ts keyword.control.loop.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts punctuation.terminator.statement.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts punctuation.terminator.statement.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts meta.brace.round.ts
^
source.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts comment.block.ts
^^
source.ts comment.block.ts punctuation.definition.comment.ts
^
source.ts
^
source.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.block.ts punctuation.definition.block.ts

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

@ -0,0 +1,5 @@
/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/{}
/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ of /*5*/ a /*6*/) /*7*/{}
/*0*/ for /*1*/ ( /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/ {}
/*0*/ for /*1*/ ( /*3*/ x /*4*/ of /*5*/ a /*6*/) /*7*/ {}
/*0*/ for /*1*/ ( /*2*/ a /*3*/ ; /*4*/ a /*5*/ ; /*6*/ a /*7*/) /*8*/ {}