From 139d90dbc1640d26981e17983f439e9f11a06617 Mon Sep 17 00:00:00 2001 From: lqdev Date: Tue, 20 Jul 2021 20:26:52 +0200 Subject: language_toml added --- README.md | 1 + plugins/language_toml.lua | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 plugins/language_toml.lua 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", + }, +} -- cgit v1.2.3