aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_c7.lua
diff options
context:
space:
mode:
authorThaCuber <70547062+thacuber2a03@users.noreply.github.com>2023-10-29 07:23:26 -0400
committerGitHub <noreply@github.com>2023-10-29 12:23:26 +0100
commitd76503024e223f2cb56c29ba355d41520425f05d (patch)
tree8b66619b40f8f5ad5c118bd50c2eb83eac99e317 /plugins/language_c7.lua
parent02a59293a9b2d2f4e986d0543e6a21b65a35451a (diff)
downloadlite-xl-plugins-d76503024e223f2cb56c29ba355d41520425f05d.tar.gz
lite-xl-plugins-d76503024e223f2cb56c29ba355d41520425f05d.zip
Add `language_c7` and update `language_fe` (#328)
* update lang_fe and add lang_c7 * actually add the files * fixed language_fe * add to meta_languages and bump * space * .*
Diffstat (limited to 'plugins/language_c7.lua')
-rw-r--r--plugins/language_c7.lua80
1 files changed, 80 insertions, 0 deletions
diff --git a/plugins/language_c7.lua b/plugins/language_c7.lua
new file mode 100644
index 0000000..2c3e2fc
--- /dev/null
+++ b/plugins/language_c7.lua
@@ -0,0 +1,80 @@
+-- mod-version:3
+local syntax = require "core.syntax"
+
+syntax.add {
+ name = "cel7",
+ files = "%.c7$",
+ comment = ";",
+ patterns = {
+ { pattern = ";.*", type = "comment" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = "0x4000", type = "literal" },
+ { pattern = "0x4040", type = "literal" },
+ { pattern = "0x52a0", type = "literal" },
+ { pattern = "0x[%da-fA-F]+", type = "number" },
+ { pattern = "-?%d+[%d%.]*", type = "number" },
+ { pattern = "-?%.?%d+", type = "number" },
+ { pattern = "'", type = "symbol" },
+ { pattern = "=", type = "symbol" },
+ { pattern = "<=?", type = "symbol" },
+ { pattern = "[%+-%*/]", type = "symbol" },
+ { pattern = "//", type = "keyword2" },
+ { pattern = "%%", type = "keyword2" },
+ { pattern = "%f[^(][^()'%s\"]+", type = "function" },
+ { pattern = "[^()'%s\"]+", type = "symbol" },
+ },
+ symbols = {
+ ["let"] = "keyword",
+ ["="] = "operator",
+ ["if"] = "keyword",
+ ["fn"] = "keyword",
+ ["mac"] = "keyword",
+ ["while"] = "keyword",
+ ["quote"] = "keyword",
+ ["'"] = "keyword",
+ ["and"] = "keyword",
+ ["or"] = "keyword",
+ ["do"] = "keyword",
+ ["cons"] = "keyword",
+ ["car"] = "keyword",
+ ["cdr"] = "keyword",
+ ["setcar"] = "keyword",
+ ["setcdr"] = "keyword",
+ ["list"] = "keyword",
+ ["not"] = "keyword",
+ ["is"] = "keyword",
+ ["atom"] = "keyword",
+ ["print"] = "keyword",
+ ["<"] = "operator",
+ ["<="] = "operator",
+ ["="] = "operator",
+ ["+"] = "operator",
+ ["-"] = "operator",
+ ["*"] = "operator",
+ ["/"] = "operator",
+ ["nil"] = "literal",
+ ["t"] = "literal",
+
+ -- reserved variables (config)
+ ["title"] = "keyword2",
+ ["width"] = "keyword2",
+ ["height"] = "keyword2",
+ ["debug"] = "keyword2",
+
+ -- callbacks
+ ["init"] = "keyword2",
+ ["step"] = "keyword2",
+ ["keydown"] = "keyword2",
+ ["keyup"] = "keyword2",
+
+ -- built-in functions
+ ["quit"] = "keyword2",
+ ["rand"] = "keyword2",
+ ["poke"] = "keyword2",
+ ["peek"] = "keyword2",
+ ["color"] = "keyword2",
+ ["put"] = "keyword2",
+ ["get"] = "keyword2",
+ ["fill"] = "keyword2",
+ }
+}