Permalink
Browse files

Properly scope method parameters.

  • Loading branch information...
1 parent 91333e5 commit 9ad9d90d08125d9fdff13c1549ea3aa42fec7087 @infininight infininight committed Oct 24, 2011
Showing with 50 additions and 8 deletions.
  1. +50 −8 Syntaxes/Ruby.plist
View
@@ -401,8 +401,6 @@
</dict>
<key>comment</key>
<string>the method pattern comes from the symbol pattern, see there for a explaination</string>
- <key>contentName</key>
- <string>variable.parameter.function.ruby</string>
<key>end</key>
<string>\)</string>
<key>endCaptures</key>
@@ -418,8 +416,31 @@
<key>patterns</key>
<array>
<dict>
- <key>include</key>
- <string>$self</string>
+ <key>begin</key>
+ <string>(?![\s,)])</string>
+ <key>end</key>
+ <string>(?=[,)])</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.variable.ruby</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\G([&amp;*]?)[_a-zA-Z][_a-zA-Z0-9]*</string>
+ <key>name</key>
+ <string>variable.parameter.function.ruby</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>$self</string>
+ </dict>
+ </array>
</dict>
</array>
</dict>
@@ -449,17 +470,38 @@
</dict>
<key>comment</key>
<string>same as the previous rule, but without parentheses around the arguments</string>
- <key>contentName</key>
- <string>variable.parameter.function.ruby</string>
<key>end</key>
<string>$</string>
<key>name</key>
<string>meta.function.method.with-arguments.ruby</string>
<key>patterns</key>
<array>
<dict>
- <key>include</key>
- <string>$self</string>
+ <key>begin</key>
+ <string>(?![\s,])</string>
+ <key>end</key>
+ <string>(?=,|$)</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.variable.ruby</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\G([&amp;*]?)[_a-zA-Z][_a-zA-Z0-9]*</string>
+ <key>name</key>
+ <string>variable.parameter.function.ruby</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>$self</string>
+ </dict>
+ </array>
</dict>
</array>
</dict>

0 comments on commit 9ad9d90

Please sign in to comment.