Permalink
Browse files

Minor enhancement of signature gramamr

git-svn-id: http://svn.textmate.org/trunk/Bundles/Standard ML.tmbundle@7831 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent d5429e1 commit 2b8d772bafa0e9ef000ca5a4c48dd563f1e80853 @commonlisp commonlisp committed Jul 27, 2007
Showing with 76 additions and 32 deletions.
  1. +76 −32 Syntaxes/Standard ML.plist
@@ -28,32 +28,8 @@
<string>keyword.other.ml</string>
</dict>
<dict>
- <key>begin</key>
- <string>\b(sig)\b</string>
- <key>captures</key>
- <dict>
- <key>1</key>
- <dict>
- <key>name</key>
- <string>keyword.other.delimiter.ml</string>
- </dict>
- <key>2</key>
- <dict>
- <key>name</key>
- <string>keyword.other.delimiter.ml</string>
- </dict>
- </dict>
- <key>end</key>
- <string>\b(end)\b</string>
- <key>name</key>
- <string>meta.module.sigdec.ml</string>
- <key>patterns</key>
- <array>
- <dict>
- <key>include</key>
- <string>#spec</string>
- </dict>
- </array>
+ <key>include</key>
+ <string>#sigdecl</string>
</dict>
<dict>
<key>match</key>
@@ -241,6 +217,35 @@
</dict>
</array>
</dict>
+ <key>sigdecl</key>
+ <dict>
+ <key>begin</key>
+ <string>\b(sig)\b</string>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.other.delimiter.ml</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.other.delimiter.ml</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>\b(end)\b</string>
+ <key>name</key>
+ <string>meta.module.sigdec.ml</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#spec</string>
+ </dict>
+ </array>
+ </dict>
<key>spec</key>
<dict>
<key>patterns</key>
@@ -253,20 +258,18 @@
<key>name</key>
<string>keyword.other.ml</string>
</dict>
- <key>2</key>
+ <key>3</key>
<dict>
<key>name</key>
<string>entity.name.type.abbrev.ml</string>
</dict>
</dict>
<key>match</key>
- <string>\b(type)\s+([a-zA-Z][a-zA-Z0-9'_]*)</string>
+ <string>\b(eqtype|type)\s+('[a-zA-Z][a-zA-Z0-9]*\s+)?([a-zA-Z][a-zA-Z0-9'_]*)</string>
<key>name</key>
<string>meta.spec.ml.type</string>
</dict>
<dict>
- <key>begin</key>
- <string>\b(datatype)\s+([a-zA-Z][a-zA-Z0-9'_]*)\s*(?==)</string>
<key>captures</key>
<dict>
<key>1</key>
@@ -277,11 +280,43 @@
<key>2</key>
<dict>
<key>name</key>
+ <string>entity.name.type.exception.ml</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.other.ml</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\b(exception)\s+([a-zA-Z][a-zA-Z0-9'_]*)(\s+of)?</string>
+ <key>name</key>
+ <string>meta.spec.ml.exception</string>
+ </dict>
+ <dict>
+ <key>begin</key>
+ <string>(?x)\b(datatype)
+ (\s+('[a-zA-Z][a-zA-Z0-9'_]*))?
+ \s+([a-zA-Z][a-zA-Z0-9'_]*)\s*(?==)</string>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.other.ml</string>
+ </dict>
+ <key>4</key>
+ <dict>
+ <key>name</key>
<string>entity.name.type.datatype.ml</string>
</dict>
</dict>
+ <key>comment</key>
+ <string>|
+ (\(\s*'[a-zA-Z][a-zA-Z0-9'_]*
+ (\s*,\s*'[a-zA-Z][a-zA-Z0-9'_]*\s*)*\))</string>
<key>end</key>
- <string>(?=val|type|eqtype|datatype|structure|include)</string>
+ <string>(?=val|type|eqtype|datatype|structure|include|exception)</string>
<key>name</key>
<string>meta.spec.ml.datatype</string>
<key>patterns</key>
@@ -354,6 +389,11 @@
<key>name</key>
<string>keyword.other.ml</string>
</dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>variable.other.val.ml</string>
+ </dict>
</dict>
<key>match</key>
<string>\b(val)\s*([^:]+)\s*:</string>
@@ -377,12 +417,16 @@
</dict>
</dict>
<key>end</key>
- <string>(?=val|type|eqtype|datatype|structure|include)</string>
+ <string>(?=val|type|eqtype|datatype|structure|include|exception)</string>
<key>name</key>
<string>meta.spec.ml.structure</string>
<key>patterns</key>
<array>
<dict>
+ <key>include</key>
+ <string>#sigdecl</string>
+ </dict>
+ <dict>
<key>match</key>
<string>\b(sharing)\b</string>
<key>name</key>

0 comments on commit 2b8d772

Please sign in to comment.