Skip to content

Commit

Permalink
Indexer is something that has identifier(parameter) followed by [ wit…
Browse files Browse the repository at this point in the history
…h or without type annotation

Fixes #197
  • Loading branch information
sheetalkamat committed Sep 26, 2016
1 parent 9e3d7a2 commit 25e792b
Show file tree
Hide file tree
Showing 6 changed files with 362 additions and 8 deletions.
4 changes: 2 additions & 2 deletions TypeScript.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ repository:

indexer-declaration:
name: meta.indexer.declaration.ts
begin: (?:(?<!\.|\$)\b(readonly)\s*)?(\[)
begin: (?:(?<!\.|\$)\b(readonly)\s*)?(\[)(?=\s*[_$[:alpha:]][_$[:alnum:]]*\s*[:\]])
beginCaptures:
'1': { name: storage.modifier.ts }
'2': { name: meta.brace.square.ts }
Expand All @@ -543,7 +543,7 @@ repository:

indexer-parameter:
name: meta.indexer.parameter.ts
match: ([_$[:alpha:]][_$[:alnum:]]*)(?=\:)
match: ([_$[:alpha:]][_$[:alnum:]]*)
captures:
'1': { name: variable.parameter.ts}

Expand Down
4 changes: 2 additions & 2 deletions TypeScript.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@
<key>name</key>
<string>meta.indexer.declaration.ts</string>
<key>begin</key>
<string>(?:(?&lt;!\.|\$)\b(readonly)\s*)?(\[)</string>
<string>(?:(?&lt;!\.|\$)\b(readonly)\s*)?(\[)(?=\s*[_$[:alpha:]][_$[:alnum:]]*\s*[:\]])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down Expand Up @@ -1781,7 +1781,7 @@
<key>name</key>
<string>meta.indexer.parameter.ts</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)(?=\:)</string>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>captures</key>
<dict>
<key>1</key>
Expand Down
4 changes: 2 additions & 2 deletions TypeScriptReact.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@
<key>name</key>
<string>meta.indexer.declaration.tsx</string>
<key>begin</key>
<string>(?:(?&lt;!\.|\$)\b(readonly)\s*)?(\[)</string>
<string>(?:(?&lt;!\.|\$)\b(readonly)\s*)?(\[)(?=\s*[_$[:alpha:]][_$[:alnum:]]*\s*[:\]])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down Expand Up @@ -1785,7 +1785,7 @@
<key>name</key>
<string>meta.indexer.parameter.tsx</string>
<key>match</key>
<string>([_$[:alpha:]][_$[:alnum:]]*)(?=\:)</string>
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
<key>captures</key>
<dict>
<key>1</key>
Expand Down
Loading

0 comments on commit 25e792b

Please sign in to comment.