summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCooper Pierce <cppierce@andrew.cmu.edu>2020-05-17 17:13:55 -0400
committerDavid Peter <sharkdp@users.noreply.github.com>2020-05-19 06:40:24 +0200
commit5074b96cd54094dd9000ebd1bb37ca325a81af53 (patch)
treea54ba2778e9c91c5a930217175a669747476102c
parent3094ac90b70515cb0c476b4f3984b0559c94635a (diff)
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.
-rw-r--r--assets/README.md6
-rw-r--r--assets/syntaxes/sml.sublime-syntax33
2 files changed, 39 insertions, 0 deletions
diff --git a/assets/README.md b/assets/README.md
index 77f6f3a8..2fba9fe9 100644
--- a/assets/README.md
+++ b/assets/README.md
@@ -34,6 +34,7 @@ The following files have been manually modified after converting from a `.tmLang
* `Dart.sublime-syntax` => removed `#regex.dart` include.
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types.
* `Org mode.sublime-syntax` => removed `task` file type.
+* `SML.sublime_syntax` => removed `ml` file type.
### Non-submodule additions
@@ -42,3 +43,8 @@ The following files have been manually modified after converting from a `.tmLang
* `Rego.sublime-syntax` has been added manually from https://github.com/open-policy-agent/opa/blob/master/misc/syntax/sublime/rego.sublime-syntax
as it is not kept in a standalone repository. The file is generated from
https://github.com/open-policy-agent/opa/blob/master/misc/syntax/textmate/Rego.tmLanguage
+* `SML.sublime_syntax` has been added manually from
+ https://github.com/seanjames777/SML-Language-Definitiona as it is not
+ kept in a standalone repository. The file generated is from
+ https://github.com/seanjames777/SML-Language-Definition/blob/master/sml.tmLanguage
+
diff --git a/assets/syntaxes/sml.sublime-syntax b/assets/syntaxes/sml.sublime-syntax
new file mode 100644
index 00000000..0355884b
--- /dev/null
+++ b/assets/syntaxes/sml.sublime-syntax
@@ -0,0 +1,33 @@
+%YAML 1.2
+---
+# http://www.sublimetext.com/docs/3/syntax.html
+name: SML
+file_extensions:
+ - sml
+ - cm
+ - sig
+scope: source.sml
+contexts:
+ main:
+ - 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
+ comment: SML keywords
+ scope: keyword.source.sml
+ - match: '\b[0-9]+\b'
+ comment: Numeric constants
+ scope: constant.numeric.sml
+ - match: '\b[A-Z]([A-z0-9]*)\b'
+ comment: Built in types
+ scope: support.type.sml
+ - match: '"(\\"|[^"])*"'
+ comment: String constant
+ scope: string.sml
+ - match: \(\*
+ comment: Comment
+ push:
+ - meta_scope: comment.sml
+ - match: \*\)
+ pop: true
+ - match: '(\(\)|=>|::|\[\]|->|:>)'
+ comment: Character
+ scope: constant.character.sml
+