aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_lox.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/language_lox.lua')
-rw-r--r--plugins/language_lox.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/language_lox.lua b/plugins/language_lox.lua
new file mode 100644
index 0000000..a6b3c43
--- /dev/null
+++ b/plugins/language_lox.lua
@@ -0,0 +1,34 @@
+-- mod-version:3
+local syntax = require 'core.syntax'
+
+syntax.add {
+ name = "Lox",
+ files = { "%.lox$" },
+ comment = "//",
+ patterns = {
+ { pattern = "//.-\n", type = "comment" },
+ { pattern = { '"', '"' }, type = "string" },
+ { pattern = "%a[%w_]*()%s*%f[(]", type = {"function", "normal"} },
+ { pattern = "[%a_][%w_]*%s*%f[(]", type = "function" },
+ { pattern = "%d+%.?%d*", type = "number" },
+ { pattern = "%a%w*", type = "symbol" },
+ },
+ symbols = {
+ ["and"] = "keyword",
+ ["class"] = "keyword",
+ ["else"] = "keyword",
+ ["false"] = "literal",
+ ["for"] = "keyword",
+ ["fun"] = "keyword",
+ ["if"] = "keyword",
+ ["nil"] = "literal",
+ ["or"] = "keyword",
+ ["print"] = "keyword",
+ ["return"] = "keyword",
+ ["super"] = "keyword2",
+ ["this"] = "keyword2",
+ ["true"] = "keyword",
+ ["var"] = "keyword",
+ ["while"] = "keyword",
+ },
+}