diff options
| author | rxi <rxi@users.noreply.github.com> | 2020-06-23 13:26:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-23 13:26:39 +0100 |
| commit | e7d3925f739e87f4d18521a2902b678f05bbfe85 (patch) | |
| tree | 8bd3efdb05df10a40c014e07e02a4fa7c5cbd20a /plugins | |
| parent | 420bde4ae8b4e0633f54d809ce5ffc5b1b87f50e (diff) | |
| parent | 5963d30bf14deb6d299055cd3a5db2b7e8e640c4 (diff) | |
| download | pragtical-plugins-e7d3925f739e87f4d18521a2902b678f05bbfe85.tar.gz pragtical-plugins-e7d3925f739e87f4d18521a2902b678f05bbfe85.zip | |
Merge pull request #65 from imolein/elm-lang-support
Add Elm lang support
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/language_elm.lua | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/language_elm.lua b/plugins/language_elm.lua new file mode 100644 index 0000000..4f449a0 --- /dev/null +++ b/plugins/language_elm.lua @@ -0,0 +1,47 @@ +local syntax = require "core.syntax" + +syntax.add { + files = { "%.elm$" }, + comment = "%-%-", + patterns = { + { pattern = {"%-%-", "\n"}, type = "comment" }, + { pattern = { "{%-", "%-}" }, type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { '"""', '"""', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "-?0x%x+", type = "number" }, + { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, + { pattern = "-?%.?%d+f?", type = "number" }, + { pattern = "%.%.", type = "operator" }, + { pattern = "[=:|&<>%+%-%*\\/%^%%]", type = "operator" }, + { pattern = "[%a_'][%w_']*", type = "symbol" }, + }, + symbols = { + ["as"] = "keyword", + ["case"] = "keyword", + ["of"] = "keyword", + ["if"] = "keyword", + ["then"] = "keyword", + ["else"] = "keyword", + ["import"] = "keyword", + ["module"] = "keyword", + ["exposing"] = "keyword", + ["let"] = "keyword", + ["in"] = "keyword", + ["type"] = "keyword", + ["alias"] = "keyword", + ["port"] = "keyword", + ["and"] = "keyword", + ["or"] = "keyword", + ["xor"] = "keyword", + ["not"] = "keyword", + ["number"] = "keyword2", + ["Bool"] = "keyword2", + ["Char"] = "keyword2", + ["Float"] = "keyword2", + ["Int"] = "keyword2", + ["String"] = "keyword2", + ["True"] = "literal", + ["False"] = "literal", + }, +} |
