aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_tcl.lua
diff options
context:
space:
mode:
authorAdam <adamdharrison@gmail.com>2021-08-16 19:20:24 -0230
committerGitHub <noreply@github.com>2021-08-16 19:20:24 -0230
commit3dd0d666ef9ae5a35661bfe1a5eef5d73981f75f (patch)
tree53ac997ed123d8a80aa0f5d1bf0b25c88260a3c7 /plugins/language_tcl.lua
parent139d90dbc1640d26981e17983f439e9f11a06617 (diff)
parent38c70503fd7019834c6c30278e235622c451f000 (diff)
downloadlite-xl-plugins-3dd0d666ef9ae5a35661bfe1a5eef5d73981f75f.tar.gz
lite-xl-plugins-3dd0d666ef9ae5a35661bfe1a5eef5d73981f75f.zip
Merge branch 'master' into language-toml
Diffstat (limited to 'plugins/language_tcl.lua')
-rw-r--r--plugins/language_tcl.lua68
1 files changed, 68 insertions, 0 deletions
diff --git a/plugins/language_tcl.lua b/plugins/language_tcl.lua
new file mode 100644
index 0000000..31efa84
--- /dev/null
+++ b/plugins/language_tcl.lua
@@ -0,0 +1,68 @@
+-- mod-version:1 -- lite-xl 1.16
+local syntax = require "core.syntax"
+
+syntax.add {
+ files = { "%.tcl$" },
+ comment = "#",
+ patterns = {
+ { pattern = "#.-\n", type = "comment" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = "0x%x+", type = "number" },
+ { pattern = "%d+[%d%.eE]*f?", type = "number" },
+ { pattern = "%.?%d+f?", type = "number" },
+ { pattern = "%$[%a_][%w_]*", type = "literal" },
+ { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
+ { pattern = "::[%a_][%w_]*", type = "function" },
+ { pattern = "[%a_][%w_]*%f[:]", type = "function" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ },
+ symbols = {
+ ["set"] = "keyword",
+ ["unset"] = "keyword",
+ ["rename"] = "keyword",
+ ["upvar"] = "keyword",
+ ["incr"] = "keyword",
+ ["source"] = "keyword",
+ ["expr"] = "keyword",
+ ["gets"] = "keyword",
+ ["puts"] = "keyword",
+ ["package"] = "keyword",
+ ["list"] = "keyword",
+ ["dict"] = "keyword",
+ ["split"] = "join",
+ ["concat"] = "join",
+ ["lappend"] = "keyword",
+ ["lset"] = "keyword",
+ ["lassign"] = "keyword",
+ ["lindex"] = "keyword",
+ ["llength"] = "keyword",
+ ["lsearch"] = "keyword",
+ ["lrange"] = "keyword",
+ ["linsert"] = "keyword",
+ ["lreplace"] = "keyword",
+ ["lrepeat"] = "keyword",
+ ["lsort"] = "keyword",
+ ["lreverse"] = "keyword",
+ ["array"] = "keyword",
+ ["concat"] = "keyword",
+ ["regexp"] = "keyword",
+ ["for"] = "keyword",
+ ["foreach"] = "keyword",
+ ["while"] = "keyword",
+ ["case"] = "keyword",
+ ["proc"] = "keyword",
+ ["if"] = "keyword",
+ ["else"] = "keyword",
+ ["elseif"] = "keyword",
+ ["break"] = "keyword",
+ ["continue"] = "keyword",
+ ["return"] = "keyword",
+ ["eval"] = "keyword",
+ ["try"] = "keyword2",
+ ["on"] = "keyword2",
+ ["finally"] = "keyword2",
+ ["throw"] = "keyword2",
+ ["error"] = "keyword2",
+ },
+}
+