diff options
author | jgmdev <jgmdev@gmail.com> | 2021-07-07 18:43:00 -0400 |
---|---|---|
committer | jgmdev <jgmdev@gmail.com> | 2021-07-07 18:43:00 -0400 |
commit | 8765e136bc923a2de0ff08ca4f5595ac6741465e (patch) | |
tree | 3a77d3c1c9739287c2b03dbb70319ed8ec5f1c32 /plugins/language_yaml.lua | |
parent | 0d706ddd861b471bb4f148d119bc990adadabb05 (diff) | |
download | lite-xl-plugins-8765e136bc923a2de0ff08ca4f5595ac6741465e.tar.gz lite-xl-plugins-8765e136bc923a2de0ff08ca4f5595ac6741465e.zip |
Added language yaml
Diffstat (limited to 'plugins/language_yaml.lua')
-rw-r--r-- | plugins/language_yaml.lua | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/plugins/language_yaml.lua b/plugins/language_yaml.lua new file mode 100644 index 0000000..40e19b6 --- /dev/null +++ b/plugins/language_yaml.lua @@ -0,0 +1,57 @@ +-- mod-version:1 -- lite-xl 1.16 +local syntax = require "core.syntax" + +syntax.add { + files = { "%.yml$", "%.yaml$" }, + comment = "#", + patterns = { + { pattern = { "#", "\n"}, type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "%-?%.inf", type = "number" }, + { pattern = "%.NaN", type = "number" }, + { + pattern = "%&()%g+", + type = { "keyword", "literal" } + }, + { pattern = "!%g+", type = "keyword" }, + { pattern = "<<", type = "literal" }, + { + pattern = "[%s]%*()[%w%d_]+", + type = { "keyword", "keyword2" } + }, + { + pattern = "%*()[%w%d_]+", + type = { "keyword", "literal" } + }, + { + pattern = "[%[%{]()%s*[%w%d]+%g+%s*():%s", + type = { "operator", "keyword2", "operator" } + }, + { + pattern = "[%s][%w%d]+%g+%s*():%s", + type = { "keyword2", "operator" } + }, + { + pattern = "[%w%d]+%g+%s*():%s", + type = { "literal", "operator" } + }, + { pattern = "0%d+", type = "number" }, + { pattern = "0x%x+", type = "number" }, + { pattern = "[%+%-]?%d+[,%.eE:%+%d]*%d+", type = "number" }, + { pattern = "[%*%|%!>%%]", type = "keyword" }, + { pattern = "[%-:%?%*%{%}%[%]]", type = "operator" }, + -- Everything else for keywords to work + { + pattern = "[%d%a_][%g_]*()[%]%},]", + type = { "string", "operator" } + }, + { pattern = "[%d%a_][%g_]*", type = "string" }, + }, + symbols = { + ["true"] = "number", + ["false"] = "number", + ["y"] = "number", + ["n"] = "number" + } +} |