aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2021-03-19 16:50:00 +0000
committerGitHub <noreply@github.com>2021-03-19 16:50:00 +0000
commit8a8b9701b95d1ccddb4cf719468d32c72f523f1f (patch)
tree8d083196e7e3d2370f43317bef11657587347954 /plugins
parentedf05b25dd6384733aa94dfb7ecb9b176e70975d (diff)
parent522790e4eda30143edab6902863d17a61919e436 (diff)
downloadlite-xl-plugins-8a8b9701b95d1ccddb4cf719468d32c72f523f1f.tar.gz
lite-xl-plugins-8a8b9701b95d1ccddb4cf719468d32c72f523f1f.zip
Merge pull request #132 from nikneym/master
MoonScript language support
Diffstat (limited to 'plugins')
-rw-r--r--plugins/language_moon.lua61
1 files changed, 61 insertions, 0 deletions
diff --git a/plugins/language_moon.lua b/plugins/language_moon.lua
new file mode 100644
index 0000000..4817743
--- /dev/null
+++ b/plugins/language_moon.lua
@@ -0,0 +1,61 @@
+local syntax = require "core.syntax"
+
+syntax.add {
+ files = "%.moon$",
+ headers = "^#!.*[ /]moon",
+ comment = "--",
+ patterns = {
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "'", "'", '\\' }, type = "string" },
+ { pattern = { "%[%[", "%]%]" }, type = "string" },
+ { pattern = "%-%-.-\n", type = "comment" },
+ { pattern = "-?0x%x+", type = "number" },
+ { pattern = "-?%d+[%d%.eE]*", type = "number" },
+ { pattern = "-?%.?%d+", type = "number" },
+ { pattern = "%.%.%.?", type = "keyword2" },
+ { pattern = "[<>~=]=", type = "keyword2" },
+ { pattern = "[%+%-=/%*%^%%#<>]", type = "keyword2" },
+ { pattern = "[%a_][%w_]*%s*%f[(\"{]", type = "function" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ { pattern = {"\\", "[%a_][%w_]*"}, type = "function" },
+ { pattern = {"%.", "[%a_][%w_]*"}, type = "function" },
+ { pattern = {"@", "[%a_][%w_]*"}, type = "keyword2" },
+ { pattern = "!", type = "keyword2" },
+ { pattern = "[%p]", type = "keyword" },
+ },
+ symbols = {
+ ["if"] = "keyword",
+ ["then"] = "keyword",
+ ["else"] = "keyword",
+ ["when"] = "keyword",
+ ["elseif"] = "keyword",
+ ["do"] = "keyword",
+ ["->"] = "keyword",
+ ["while"] = "keyword",
+ ["for"] = "keyword",
+ ["break"] = "keyword",
+ ["continue"] = "keyword",
+ ["export"] = "keyword",
+ ["unless"] = "keyword",
+ ["return"] = "keyword",
+ ["in"] = "keyword",
+ ["not"] = "keyword",
+ ["and"] = "keyword",
+ ["or"] = "keyword",
+ ["import"] = "keyword",
+ ["as"] = "keyword",
+ ["from"] = "keyword",
+ ["class"] = "keyword",
+ ["extends"] = "keyword",
+ ["switch"] = "keyword",
+ ["with"] = "keyword",
+ ["using"] = "keyword",
+ ["super"] = "keyword2",
+ ["self"] = "keyword2",
+ ["#"] = "keyword2",
+ ["true"] = "literal",
+ ["false"] = "literal",
+ ["nil"] = "literal",
+ },
+}
+