Permalink
Browse files

Improve comment.line matches.

  • Loading branch information...
1 parent c49ca76 commit 991fc6d4e4765bf73e5a3c38f5b6d81587ec10f5 @infininight infininight committed Nov 14, 2011
Showing with 127 additions and 30 deletions.
  1. +52 −12 Syntaxes/M.tmLanguage
  2. +75 −18 Syntaxes/Octave.tmLanguage
View
@@ -2,6 +2,8 @@
<!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>
+ <array/>
<key>keyEquivalent</key>
<string>^~M</string>
<key>name</key>
@@ -160,18 +162,37 @@
<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.matlab</string>
+ <string>punctuation.whitespace.comment.leading.matlab</string>
</dict>
</dict>
- <key>match</key>
- <string>(%%).*$\n?</string>
- <key>name</key>
- <string>comment.double.percentage.matlab</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.matlab</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.double-percentage.matlab</string>
+ </dict>
+ </array>
</dict>
<dict>
<key>begin</key>
@@ -190,18 +211,37 @@
<string>comment.block.percentage.matlab</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.matlab</string>
+ <string>punctuation.whitespace.comment.leading.matlab</string>
</dict>
</dict>
- <key>match</key>
- <string>(%).*$\n?</string>
- <key>name</key>
- <string>comment.line.percentage.matlab</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.matlab</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.percentage.matlab</string>
+ </dict>
+ </array>
</dict>
</array>
</dict>
View
@@ -166,18 +166,37 @@
<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.octave</string>
+ <string>punctuation.whitespace.comment.leading.octave</string>
</dict>
</dict>
- <key>match</key>
- <string>(%%).*$\n?</string>
- <key>name</key>
- <string>comment.double.percentage.octave</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.octave</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.double-percentage.octave</string>
+ </dict>
+ </array>
</dict>
<dict>
<key>begin</key>
@@ -196,32 +215,70 @@
<string>comment.block.percentage.octave</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.octave</string>
+ <string>punctuation.whitespace.comment.leading.octave</string>
</dict>
</dict>
- <key>match</key>
- <string>(%).*$\n?</string>
- <key>name</key>
- <string>comment.line.percentage.octave</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.octave</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.percentage.octave</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.octave</string>
+ <string>punctuation.whitespace.comment.leading.octave</string>
</dict>
</dict>
- <key>match</key>
- <string>(#).*$\n?</string>
- <key>name</key>
- <string>comment.line.number-sign.octave</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.octave</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\n</string>
+ <key>name</key>
+ <string>comment.line.number-sign.octave</string>
+ </dict>
+ </array>
</dict>
</array>
</dict>

0 comments on commit 991fc6d

Please sign in to comment.