aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_toml.lua
diff options
context:
space:
mode:
authorAdam <adamdharrison@gmail.com>2021-08-16 19:20:31 -0230
committerGitHub <noreply@github.com>2021-08-16 19:20:31 -0230
commita42a0d57b08a9080ed9fd8fa84f1269e3847980f (patch)
tree53ac997ed123d8a80aa0f5d1bf0b25c88260a3c7 /plugins/language_toml.lua
parent38c70503fd7019834c6c30278e235622c451f000 (diff)
parent3dd0d666ef9ae5a35661bfe1a5eef5d73981f75f (diff)
downloadlite-xl-plugins-a42a0d57b08a9080ed9fd8fa84f1269e3847980f.tar.gz
lite-xl-plugins-a42a0d57b08a9080ed9fd8fa84f1269e3847980f.zip
Merge pull request #48 from liquidev/language-toml
Added TOML syntax
Diffstat (limited to 'plugins/language_toml.lua')
-rw-r--r--plugins/language_toml.lua32
1 files changed, 32 insertions, 0 deletions
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",
+ },
+}