aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--manifest.json21
-rw-r--r--plugins/language_gravity.lua98
-rw-r--r--plugins/language_lox.lua34
-rw-r--r--plugins/language_umka.lua67
4 files changed, 220 insertions, 0 deletions
diff --git a/manifest.json b/manifest.json
index fb01048..4af615f 100644
--- a/manifest.json
+++ b/manifest.json
@@ -543,6 +543,13 @@
"mod_version": "3"
},
{
+ "description": "Syntax for the [Gravity](https://marcobambini.github.io/gravity/) programming language.",
+ "version": "0.1",
+ "path": "plugins/language_gravity.lua",
+ "id": "language_gravity",
+ "mod_version": "3"
+ },
+ {
"description": "Syntax for the [Haxe](https://haxe.org) programming language",
"version": "0.1",
"path": "plugins/language_haxe.lua",
@@ -642,6 +649,13 @@
"mod_version": "3"
},
{
+ "description": "Syntax for the [Lox](http://craftinginterpreters.com/the-lox-language.html) programming language, featured in the book '[Crafting Interpreters](http://craftinginterpreters.com/)'.",
+ "version": "0.1",
+ "path": "plugins/language_lox.lua",
+ "id": "language_lox",
+ "mod_version": "3"
+ },
+ {
"description": "Syntax for the Make build system language",
"version": "0.1",
"path": "plugins/language_make.lua",
@@ -839,6 +853,13 @@
"mod_version": "3"
},
{
+ "description": "Syntax for the [Umka](https://github.com/vtereshkov/umka-lang) programming language.",
+ "version": "0.1",
+ "path": "plugins/language_umka.lua",
+ "id": "language_umka",
+ "mod_version": "3"
+ },
+ {
"description": "Syntax for the [Tcl](https://www.tcl.tk/) programming language",
"version": "0.1",
"path": "plugins/language_tcl.lua",
diff --git a/plugins/language_gravity.lua b/plugins/language_gravity.lua
new file mode 100644
index 0000000..d5bd761
--- /dev/null
+++ b/plugins/language_gravity.lua
@@ -0,0 +1,98 @@
+-- mod-version:3
+local syntax = require 'core.syntax'
+
+syntax.add {
+ name = "Gravity",
+ files = { "%.gravity$" },
+ comment = "//",
+ block_comment = {"/*", "*/"},
+ patterns = {
+ { pattern = "#![^\n]+", type = "comment" },
+ { pattern = "//[^\n]+", type = "comment" },
+ { pattern = { "/%*", "%*/" }, type = "comment" },
+ { pattern = { '"', '"', "\\" }, type = "string" },
+
+ { pattern = "[~=!<>]=?", type = "operator" },
+ { pattern = "[!=]==", type = "operator" },
+ { pattern = "[%+%-%*/%%&|^]", type = "operator" },
+ { pattern = "%.%.[%.<]", type = "operator" },
+
+ { pattern = "0[bB][0-1]+%f[%D]", type = "number" },
+ { pattern = "0[oO][0-7]+", type = "number" },
+ { pattern = "0[xX]%x+", type = "number" },
+ { pattern = "%.?%d+[eE]?%-?%d*", type = "number" },
+
+ { pattern = "#%s*include%s*%f[\"]", type = "literal"},
+ { pattern = "#%s*unittest%s*%f[{]", type = "literal"},
+
+ --{ pattern = "[%+%-%*/]%s*()%(", type = { "function", "normal" }},
+ { pattern = "[%a_][%w_]+%s*%f[%(]", type = "function"},
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ },
+ symbols = {
+ ["true"] = "literal",
+ ["false"] = "literal",
+ ["null"] = "literal",
+ ["self"] = "keyword2",
+
+ ["Object"] = "literal",
+ ["Int"] = "literal",
+ ["Float"] = "literal",
+ ["String"] = "literal",
+ ["Bool"] = "literal",
+ ["Null"] = "literal",
+ ["Class"] = "literal",
+ ["Function"] = "literal",
+ ["Fiber"] = "literal",
+ ["Instance"] = "literal",
+ ["List"] = "literal",
+ ["Map"] = "literal",
+ ["Range"] = "literal",
+
+ ["System"] = "literal",
+ ["Math"] = "literal",
+ ["File"] = "literal",
+ ["ENV"] = "literal",
+
+ ["if"] = "keyword",
+ ["in"] = "keyword",
+ ["or"] = "keyword",
+ ["is"] = "operator",
+ ["for"] = "keyword",
+ ["var"] = "keyword",
+ ["and"] = "keyword",
+ ["not"] = "keyword",
+ ["func"] = "keyword",
+ ["else"] = "keyword",
+ ["true"] = "keyword",
+ ["enum"] = "keyword",
+ ["case"] = "keyword",
+ ["null"] = "keyword",
+ ["file"] = "keyword",
+ ["lazy"] = "keyword",
+ ["super"] = "keyword",
+ ["break"] = "keyword",
+ ["while"] = "keyword",
+ ["class"] = "keyword",
+ ["const"] = "keyword",
+ ["event"] = "keyword",
+ ["_func"] = "keyword",
+ ["_args"] = "keyword",
+ ["struct"] = "keyword",
+ ["repeat"] = "keyword",
+ ["switch"] = "keyword",
+ ["return"] = "keyword",
+ ["public"] = "keyword",
+ ["static"] = "keyword",
+ ["extern"] = "keyword",
+ ["import"] = "keyword",
+ ["module"] = "keyword",
+ ["default"] = "keyword",
+ ["private"] = "keyword",
+ ["continue"] = "keyword",
+ ["internal"] = "keyword",
+ ["undefined"] = "keyword",
+ }
+}
+
+
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",
+ },
+}
diff --git a/plugins/language_umka.lua b/plugins/language_umka.lua
new file mode 100644
index 0000000..3575753
--- /dev/null
+++ b/plugins/language_umka.lua
@@ -0,0 +1,67 @@
+-- mod-version:3
+local syntax = require 'core.syntax'
+
+syntax.add {
+ name = "Umka",
+ files = { "%.um$" },
+ comment = "//",
+ block_comment = { "/*", "*/" },
+ patterns = {
+ { pattern = "//.-\n", type = "comment" },
+ { pattern = { "/%*", "%*/" }, type = "comment" },
+ { pattern = "0x%x+", type = "number" },
+ { pattern = "%d+%.?%d*[Ee]%-?%d+", type = "number" },
+ { pattern = "%d+%.?%d*", type = "number" },
+ { pattern = {'"', '"', '\\'}, type = "string" },
+ { pattern = {"'", "'", '\\'}, type = "string" },
+
+ { pattern = ":=", type = "operator" },
+ { pattern = "%.%.", type = "operator" },
+ { pattern = "[%^%+%-%*/%%&|~<>!=]", type = "operator" },
+ { pattern = "[%a_][%w_]*()%*?()%s*%f[%(]", type = {"function", "operator", "normal"} },
+ { pattern = "%u[%w_]*", type = "literal" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ },
+ symbols = {
+ ["break"] = "keyword",
+ ["case"] = "keyword",
+ ["const"] = "keyword",
+ ["continue"] = "keyword",
+ ["default"] = "keyword",
+ ["else"] = "keyword",
+ ["for"] = "keyword",
+ ["fn"] = "keyword",
+ ["import"] = "keyword",
+ ["interface"] = "keyword",
+ ["if"] = "keyword",
+ ["in"] = "keyword",
+ ["map"] = "keyword",
+ ["return"] = "keyword",
+ ["str"] = "keyword",
+ ["struct"] = "keyword",
+ ["switch"] = "keyword",
+ ["type"] = "keyword",
+ ["var"] = "keyword",
+ ["weak"] = "keyword",
+
+ -- types
+ ["void"] = "keyword2",
+ ["int8"] = "keyword2",
+ ["int16"] = "keyword2",
+ ["int32"] = "keyword2",
+ ["int"] = "keyword2",
+ ["uint8"] = "keyword2",
+ ["uint16"] = "keyword2",
+ ["uint32"] = "keyword2",
+ ["uint"] = "keyword2",
+ ["real32"] = "keyword2",
+ ["real"] = "keyword2",
+ ["bool"] = "keyword2",
+ ["true"] = "literal",
+ ["false"] = "literal",
+ ["char"] = "keyword2",
+ ["fiber"] = "keyword2",
+ ["any"] = "keyword2",
+ ["null"] = "literal",
+ },
+}