Skip to content

Commit

Permalink
Match function parameters individually
Browse files Browse the repository at this point in the history
This allows for easier selection of each item.

Fixes jashkenas#103
  • Loading branch information
infininight committed Mar 20, 2013
1 parent dcceda0 commit e8d02ce
Show file tree
Hide file tree
Showing 2 changed files with 292 additions and 12 deletions.
152 changes: 146 additions & 6 deletions Syntaxes/CoffeeScript (Literate).tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,79 @@
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.function.coffee</string>
<string>punctuation.definition.parameters.begin.coffee</string>
</dict>
<key>2</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.function.coffee</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.coffee</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>string.quoted.double.coffee</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.coffee</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.coffee</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>string.quoted.single.coffee</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.coffee</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.coffee</string>
</dict>
</dict>
<key>match</key>
<string>([^()\s,]+)\s+(=)\s+(?:((")[^"]*("))|((')[^']*(')))</string>
</dict>
<dict>
<key>match</key>
<string>[^()\s,]+</string>
<key>name</key>
<string>variable.parameter.function.coffee</string>
</dict>
<dict>
<key>match</key>
<string>,</string>
<key>name</key>
<string>punctuation.separator.arguments.coffee</string>
</dict>
</array>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.begin.coffee</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.function.coffee</string>
Expand All @@ -569,7 +639,7 @@
<key>comment</key>
<string>match stuff like: a -&gt;</string>
<key>match</key>
<string>(\([^()]*?\))\s*([=-]&gt;)</string>
<string>(\()([^()]*?)(\))\s*([=-]&gt;)</string>
<key>name</key>
<string>meta.inline.function.coffee</string>
</dict>
Expand Down Expand Up @@ -846,19 +916,89 @@
<key>name</key>
<string>entity.name.function.coffee</string>
</dict>
<key>4</key>
<key>5</key>
<dict>
<key>name</key>
<string>variable.parameter.function.coffee</string>
<string>punctuation.definition.parameters.begin.coffee</string>
</dict>
<key>5</key>
<key>6</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.function.coffee</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.coffee</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>string.quoted.double.coffee</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.coffee</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.coffee</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>string.quoted.single.coffee</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.coffee</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.coffee</string>
</dict>
</dict>
<key>match</key>
<string>([^()\s,]+)\s+(=)\s+(?:((")[^"]*("))|((')[^']*(')))</string>
</dict>
<dict>
<key>match</key>
<string>[^()\s,]+</string>
<key>name</key>
<string>variable.parameter.function.coffee</string>
</dict>
<dict>
<key>match</key>
<string>,</string>
<key>name</key>
<string>punctuation.separator.arguments.coffee</string>
</dict>
</array>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.begin.coffee</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>storage.type.function.coffee</string>
</dict>
</dict>
<key>match</key>
<string>(\s*)(?=@?[a-zA-Z\$_])(@?[a-zA-Z\$_](\w|\$|:|\.)*\s*(?=[:=](\s*\(.*\))?\s*((=|-)&gt;)))</string>
<string>(\s*)(?=@?[a-zA-Z\$_])(@?[a-zA-Z\$_](\w|\$|:|\.)*\s*(?=[:=](\s*(\()(.*)(\)))?\s*((=|-)&gt;)))</string>
<key>name</key>
<string>meta.function.coffee</string>
</dict>
Expand Down
152 changes: 146 additions & 6 deletions Syntaxes/CoffeeScript.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,79 @@
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.function.coffee</string>
<string>punctuation.definition.parameters.begin.coffee</string>
</dict>
<key>2</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.function.coffee</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.coffee</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>string.quoted.double.coffee</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.coffee</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.coffee</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>string.quoted.single.coffee</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.coffee</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.coffee</string>
</dict>
</dict>
<key>match</key>
<string>([^()\s,]+)\s+(=)\s+(?:((")[^"]*("))|((')[^']*(')))</string>
</dict>
<dict>
<key>match</key>
<string>[^()\s,]+</string>
<key>name</key>
<string>variable.parameter.function.coffee</string>
</dict>
<dict>
<key>match</key>
<string>,</string>
<key>name</key>
<string>punctuation.separator.arguments.coffee</string>
</dict>
</array>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.begin.coffee</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.function.coffee</string>
Expand All @@ -39,7 +109,7 @@
<key>comment</key>
<string>match stuff like: a -&gt;</string>
<key>match</key>
<string>(\([^()]*?\))\s*([=-]&gt;)</string>
<string>(\()([^()]*?)(\))\s*([=-]&gt;)</string>
<key>name</key>
<string>meta.inline.function.coffee</string>
</dict>
Expand Down Expand Up @@ -325,12 +395,82 @@
<key>name</key>
<string>entity.name.function.coffee</string>
</dict>
<key>4</key>
<key>5</key>
<dict>
<key>name</key>
<string>variable.parameter.function.coffee</string>
<string>punctuation.definition.parameters.begin.coffee</string>
</dict>
<key>5</key>
<key>6</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.function.coffee</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.coffee</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>string.quoted.double.coffee</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.coffee</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.coffee</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>string.quoted.single.coffee</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.coffee</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.coffee</string>
</dict>
</dict>
<key>match</key>
<string>([^()\s,]+)\s+(=)\s+(?:((")[^"]*("))|((')[^']*(')))</string>
</dict>
<dict>
<key>match</key>
<string>[^()\s,]+</string>
<key>name</key>
<string>variable.parameter.function.coffee</string>
</dict>
<dict>
<key>match</key>
<string>,</string>
<key>name</key>
<string>punctuation.separator.arguments.coffee</string>
</dict>
</array>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.begin.coffee</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>storage.type.function.coffee</string>
Expand All @@ -342,7 +482,7 @@
(?=@?[a-zA-Z\$_])
(
@?[a-zA-Z\$_](\w|\$|:|\.)*\s*
(?=[:=](\s*\(.*\))?\s*([=-]&gt;))
(?=[:=](\s*(\()(.*)(\)))?\s*([=-]&gt;))
)
</string>
<key>name</key>
Expand Down

0 comments on commit e8d02ce

Please sign in to comment.