aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlqdev <liquidekgaming@gmail.com>2021-07-20 20:26:52 +0200
committerlqdev <liquidekgaming@gmail.com>2021-07-20 20:26:52 +0200
commit139d90dbc1640d26981e17983f439e9f11a06617 (patch)
treebd36e5cd34b67cf4e2e787cfd1316408d0d3109f
parentdb213743f769df28e370cbd49a73e147756612c8 (diff)
downloadlite-xl-plugins-139d90dbc1640d26981e17983f439e9f11a06617.tar.gz
lite-xl-plugins-139d90dbc1640d26981e17983f439e9f11a06617.zip
language_toml added
-rw-r--r--README.md1
-rw-r--r--plugins/language_toml.lua32
2 files changed, 33 insertions, 0 deletions
diff --git a/README.md b/README.md
index a31c13a..f7c5efe 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,7 @@ Plugin | Description
[`language_sh`](plugins/language_sh.lua?raw=1) | Syntax for shell scripting language
[`language_teal`](plugins/language_teal.lua?raw=1) | Syntax for the [Teal](https://github.com/teal-language/tl) programming language, a typed dialect of Lua.
[`language_tex`](plugins/language_tex.lua?raw=1) | Syntax for the [LaTeX](https://www.latex-project.org/) typesetting language
+[`language_toml`](plugins/language_toml.lua?raw=1) | Syntax for the [TOML](https://toml.io/en/) configuration language
[`language_v`](plugins/language_v.lua?raw=1) | Syntax for the [V](https://vlang.io/) programming language
[`language_wren`](plugins/language_wren.lua?raw=1) | Syntax for the [Wren](http://wren.io/) programming language
[`language_zig`](plugins/language_zig.lua?raw=1) | Syntax for the [Zig](https://ziglang.org/) programming language
diff --git a/plugins/language_toml.lua b/plugins/language_toml.lua
new file mode 100644
index 0000000..9de31f9
--- /dev/null
+++ b/plugins/language_toml.lua
@@ -0,0 +1,32 @@
+-- lite-xl 1.16
+
+local syntax = require "core.syntax"
+
+syntax.add {
+ files = { "%.toml$" },
+ comment = '#',
+ patterns = {
+ { pattern = "#.-\n", type = "comment" },
+ { pattern = { '"""', '"""', '\\' }, type = "string" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "'''", "'''" }, type = "string" },
+ { pattern = { "'", "'" }, type = "string" },
+ { pattern = "[A-Za-z0-9_%.%-]+%s*%f[=]", type = "function" },
+ { pattern = "%[[A-Za-z0-9_%.%- ]+%]", type = "keyword" },
+ { pattern = "%[%[[A-Za-z0-9_%.%- ]+%]%]", type = "keyword" },
+ { pattern = "[%-+]?[0-9_]+%.[0-9_]+[eE][%-+]?[0-9_]+", type = "number" },
+ { pattern = "[%-+]?[0-9_]+%.[0-9_]+", type = "number" },
+ { pattern = "[%-+]?[0-9_]+[eE][%-+]?[0-9_]+", type = "number" },
+ { pattern = "[%-+]?[0-9_]+", type = "number" },
+ { pattern = "[%-+]?0x[0-9a-fA-F_]+", type = "number" },
+ { pattern = "[%-+]?0o[0-7_]+", type = "number" },
+ { pattern = "[%-+]?0b[01_]+", type = "number" },
+ { pattern = "[%-+]?nan", type = "number" },
+ { pattern = "[%-+]?inf", type = "number" },
+ { pattern = "[a-z]+", type = "symbol" },
+ },
+ symbols = {
+ ["true"] = "literal",
+ ["false"] = "literal",
+ },
+}