aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_lox.lua
diff options
context:
space:
mode:
authorThaCuber <70547062+ThaCuber@users.noreply.github.com>2023-05-20 11:46:24 -0400
committerGitHub <noreply@github.com>2023-05-20 11:46:24 -0400
commitd2a09e6c6b960d2b95398c92e73cad24f7d4993e (patch)
tree2af45c622091553dfcba9eab5868945cb1fca5bc /plugins/language_lox.lua
parenta27e0ba00ad317c21cb06963007197ccec972ebe (diff)
downloadlite-xl-plugins-d2a09e6c6b960d2b95398c92e73cad24f7d4993e.tar.gz
lite-xl-plugins-d2a09e6c6b960d2b95398c92e73cad24f7d4993e.zip
Added a bunch of languages (#251)
* Add a bunch of language highlighters * ah shit, the manifest
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",
+ },
+}