Permalink
Browse files

Improve comment.line match.

  • Loading branch information...
1 parent 6f756d9 commit 82a9c9f29c9e53a315b86de890d44ba95d0449f2 @infininight infininight committed Nov 18, 2011
Showing with 50 additions and 12 deletions.
  1. +50 −12 Syntaxes/PHP.plist
View
@@ -343,32 +343,70 @@
<string>comment.block.php</string>
</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.php</string>
+ <string>punctuation.whitespace.comment.leading.php</string>
</dict>
</dict>
- <key>match</key>
- <string>(//).*?($\n?|(?=\?&gt;))</string>
- <key>name</key>
- <string>comment.line.double-slash.php</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.php</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n|(?=\?&gt;)</string>
+ <key>name</key>
+ <string>comment.line.number-sign.php</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.php</string>
+ <string>punctuation.whitespace.comment.leading.php</string>
</dict>
</dict>
- <key>match</key>
- <string>(#).*?($\n?|(?=\?&gt;))</string>
- <key>name</key>
- <string>comment.line.number-sign.php</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.php</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n|(?=\?&gt;)</string>
+ <key>name</key>
+ <string>comment.line.double-slash.php</string>
+ </dict>
+ </array>
</dict>
</array>
</dict>

0 comments on commit 82a9c9f

Please sign in to comment.