Permalink
Browse files

Improve comment.line match.

  • Loading branch information...
1 parent 8f5a03e commit f6810829dde7a58c3d4a29bf6b0f1a905adc2a7a @infininight infininight committed Nov 14, 2011
Showing with 56 additions and 6 deletions.
  1. +56 −6 Syntaxes/Context Free.tmLanguage
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
@@ -152,19 +152,69 @@
<array>
<dict>
<key>begin</key>
- <string>(//|#)</string>
+ <string>(^[ \t]+)?(?=#)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
- <string>punctuation.definition.comment.cfdg</string>
+ <string>punctuation.whitespace.comment.leading.cfdg</string>
</dict>
</dict>
<key>end</key>
- <string>$\n?</string>
- <key>name</key>
- <string>comment.line.cfdg</string>
+ <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.cfdg</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.number-sign.cfdg</string>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>begin</key>
+ <string>(^[ \t]+)?(?=//)</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.whitespace.comment.leading.cfdg</string>
+ </dict>
+ </dict>
+ <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.cfdg</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.double-slash.cfdg</string>
+ </dict>
+ </array>
</dict>
<dict>
<key>begin</key>

0 comments on commit f681082

Please sign in to comment.