Permalink
Browse files

Improve comment matching, supporting asterisk comments.

Due to the way the grammar is structured I have removed the deprecated comment matching for the modern grammar.
  • Loading branch information...
1 parent 0525d27 commit a93323673c7e18b2806483c6d8f4e1b7b1a0a5c0 @infininight infininight committed Oct 22, 2011
Showing with 25 additions and 25 deletions.
  1. +0 −23 Syntaxes/Fortran - Modern.tmLanguage
  2. +25 −2 Syntaxes/Fortran - Punchcard.tmLanguage
@@ -47,29 +47,6 @@
<key>patterns</key>
<array>
<dict>
- <key>begin</key>
- <string>^[Cc]\s+</string>
- <key>beginCaptures</key>
- <dict>
- <key>0</key>
- <dict>
- <key>name</key>
- <string>punctuation.definition.comment.fortran</string>
- </dict>
- </dict>
- <key>end</key>
- <string>$\n?</string>
- <key>name</key>
- <string>invalid.deprecated.comment.line.fortran</string>
- <key>patterns</key>
- <array>
- <dict>
- <key>match</key>
- <string>\\\s*\n</string>
- </dict>
- </array>
- </dict>
- <dict>
<key>include</key>
<string>source.fortran</string>
</dict>
@@ -216,7 +216,7 @@
<key>comment</key>
<string>operators</string>
<key>match</key>
- <string>((?&lt;!\=)\=(?!\=)|\-|\+|\/\/|\/|\*|::)</string>
+ <string>((?&lt;!\=)\=(?!\=)|\-|\+|\/\/|\/|(?!^)\*|::)</string>
<key>name</key>
<string>keyword.operator.fortran</string>
</dict>
@@ -400,7 +400,7 @@
</dict>
<dict>
<key>begin</key>
- <string>^[Cc]</string>
+ <string>^[Cc](?=\b|[Cc])</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
@@ -423,6 +423,29 @@
</dict>
<dict>
<key>begin</key>
+ <string>^\*</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.fortran</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>$\n?</string>
+ <key>name</key>
+ <string>comment.line.asterisk.fortran</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>match</key>
+ <string>\\\s*\n</string>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>begin</key>
<string>^\s*#\s*(error|warning)\b</string>
<key>captures</key>
<dict>

0 comments on commit a933236

Please sign in to comment.