Skip to content

Commit

Permalink
Specific scope for symbols when used as hash keys.
Browse files Browse the repository at this point in the history
Covers both 1.8 and 1.9 syntax. Needs higher precedence than keywords so that keys in hashes like `{ class: foo }` are parsed correctly.
  • Loading branch information
noniq authored and infininight committed Aug 16, 2012
1 parent b7e9875 commit 99b4e5e
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions Syntaxes/Ruby.plist
Expand Up @@ -162,6 +162,38 @@
<key>name</key> <key>name</key>
<string>invalid.deprecated.ruby</string> <string>invalid.deprecated.ruby</string>
</dict> </dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.constant.ruby</string>
</dict>
</dict>
<key>comment</key>
<string>symbols as hash key (1.9 syntax)</string>
<key>match</key>
<string>(?&gt;[a-zA-Z_]\w*(?&gt;[?!])?)(:)(?!:)</string>
<key>name</key>
<string>constant.other.symbol.hashkey.ruby</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.constant.ruby</string>
</dict>
</dict>
<key>comment</key>
<string>symbols as hash key (1.8 syntax)</string>
<key>match</key>
<string>(?&lt;!:)(:)(?&gt;[a-zA-Z_]\w*(?&gt;[?!])?)(?=\s*=&gt;)</string>
<key>name</key>
<string>constant.other.symbol.hashkey.ruby</string>
</dict>
<dict> <dict>
<key>comment</key> <key>comment</key>
<string>everything being a reserved word, not a value and needing a 'end' is a..</string> <string>everything being a reserved word, not a value and needing a 'end' is a..</string>
Expand Down Expand Up @@ -1567,22 +1599,6 @@
<key>name</key> <key>name</key>
<string>constant.other.symbol.ruby</string> <string>constant.other.symbol.ruby</string>
</dict> </dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.constant.ruby</string>
</dict>
</dict>
<key>comment</key>
<string>symbols</string>
<key>match</key>
<string>(?&gt;[a-zA-Z_]\w*(?&gt;[?!])?)(:)(?!:)</string>
<key>name</key>
<string>constant.other.symbol.ruby.19syntax</string>
</dict>
<dict> <dict>
<key>begin</key> <key>begin</key>
<string>^=begin</string> <string>^=begin</string>
Expand Down

0 comments on commit 99b4e5e

Please sign in to comment.