Permalink
Browse files

Improve comment.line match.

  • Loading branch information...
1 parent 8cf93e2 commit 5d79ef5b825ee832932c42285712f42a2c042741 @infininight infininight committed Nov 17, 2011
Showing with 50 additions and 12 deletions.
  1. +50 −12 Syntaxes/Thrift.tmLanguage
View
@@ -688,32 +688,70 @@
<key>patterns</key>
<array>
<dict>
- <key>captures</key>
+ <key>begin</key>
+ <string>(^[ \t]+)?(?=#)</string>
+ <key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
- <string>punctuation.definition.comment.thrift</string>
+ <string>punctuation.whitespace.comment.leading.thrift</string>
</dict>
</dict>
- <key>match</key>
- <string>(#).*\n?</string>
- <key>name</key>
- <string>comment.line.number-sign.thrift</string>
+ <key>end</key>
+ <string>(?!\G)</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>begin</key>
+ <string>#</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.thrift</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.number-sign.thrift</string>
+ </dict>
+ </array>
</dict>
<dict>
- <key>captures</key>
+ <key>begin</key>
+ <string>(^[ \t]+)?(?=//)</string>
+ <key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
- <string>punctuation.definition.comment.thrift</string>
+ <string>punctuation.whitespace.comment.leading.thrift</string>
</dict>
</dict>
- <key>match</key>
- <string>(//).*\n?</string>
- <key>name</key>
- <string>comment.line.double-slash.thrift</string>
+ <key>end</key>
+ <string>(?!\G)</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>begin</key>
+ <string>//</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.thrift</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.double-slash.thrift</string>
+ </dict>
+ </array>
</dict>
<dict>
<key>begin</key>

0 comments on commit 5d79ef5

Please sign in to comment.