on master help sign in
Add syntax highlighting for SML

Converted from https://github.com/seanjames777/SML-Language-Definition/blob/master/sml.tmLanguage and removed `ml` filetype to fix an (assumed) possible conflict with existing OCaml support.

commit5074b96cd54094dd9000ebd1bb37ca325a81af53 authorCooper Pierce <cppierce@andrew.cmu.edu> dateSun 17 May 2020, 17:13 (6 years ago) parent3094ac9
2 files changed+39
assets/README.md+6 assets/syntaxes/sml.sublime-syntax+33
assets/README.md+6
@@ -34,6 +34,7 @@ The following files have been manually modified after converting from a `.tmLang
3434* `Dart.sublime-syntax` => removed `#regex.dart` include.
3535* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types.
3636* `Org mode.sublime-syntax` => removed `task` file type.
37+* `SML.sublime_syntax` => removed `ml` file type.
3738
3839### Non-submodule additions
3940
@@ -42,3 +43,8 @@ The following files have been manually modified after converting from a `.tmLang
4243* `Rego.sublime-syntax` has been added manually from https://github.com/open-policy-agent/opa/blob/master/misc/syntax/sublime/rego.sublime-syntax
4344 as it is not kept in a standalone repository. The file is generated from
4445 https://github.com/open-policy-agent/opa/blob/master/misc/syntax/textmate/Rego.tmLanguage
46+* `SML.sublime_syntax` has been added manually from
47+ https://github.com/seanjames777/SML-Language-Definitiona as it is not
48+ kept in a standalone repository. The file generated is from
49+ https://github.com/seanjames777/SML-Language-Definition/blob/master/sml.tmLanguage
50+
assets/syntaxes/sml.sublime-syntaxnew file+33
@@ -0,0 +1,33 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: SML
5+file_extensions:
6+ - sml
7+ - cm
8+ - sig
9+scope: source.sml
10+contexts:
11+ main:
12+ - match: \b(EQUAL|GREATER|LESS|NONE|SOME|abstraction|abstype|and|andalso|array|as|before|bool|case|char|datatype|do|else|end|eqtype|exception|exn|false|fn|fun|functor|handle|if|in|include|infix|infixr|int|let|list|local|nil|nonfix|not|o|of|op|open|option|orelse|overload|print|raise|real|rec|ref|sharing|sig|signature|string|struct|structure|substring|then|true|type|unit|val|vector|where|while|with|withtype|word)\b
13+ comment: SML keywords
14+ scope: keyword.source.sml
15+ - match: '\b[0-9]+\b'
16+ comment: Numeric constants
17+ scope: constant.numeric.sml
18+ - match: '\b[A-Z]([A-z0-9]*)\b'
19+ comment: Built in types
20+ scope: support.type.sml
21+ - match: '"(\\"|[^"])*"'
22+ comment: String constant
23+ scope: string.sml
24+ - match: \(\*
25+ comment: Comment
26+ push:
27+ - meta_scope: comment.sml
28+ - match: \*\)
29+ pop: true
30+ - match: '(\(\)|=>|::|\[\]|->|:>)'
31+ comment: Character
32+ scope: constant.character.sml
33+