aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThaCuber <70547062+ThaCuber@users.noreply.github.com>2023-05-01 19:49:04 -0400
committerGitHub <noreply@github.com>2023-05-01 19:49:04 -0400
commita1fa9a663e1caae2176b8f18e10161521f752368 (patch)
tree0094a8dfa83ca61023358e6d9cf8cef8725431aa
parent4491c4afde636cdae19a023e1e177f4ceda8cbd6 (diff)
downloadlite-xl-plugins-a1fa9a663e1caae2176b8f18e10161521f752368.tar.gz
lite-xl-plugins-a1fa9a663e1caae2176b8f18e10161521f752368.zip
added language_tal.lua (#238)
* added language_tal.lua * forgot to link to the page about the language
-rw-r--r--manifest.json7
-rw-r--r--plugins/language_tal.lua70
2 files changed, 77 insertions, 0 deletions
diff --git a/manifest.json b/manifest.json
index c67861d..baddd9a 100644
--- a/manifest.json
+++ b/manifest.json
@@ -832,6 +832,13 @@
"mod_version": "3"
},
{
+ "description": "Syntax for the [Uxntal](https://wiki.xxiivv.com/site/uxntal) assembly language",
+ "version": "0.1",
+ "path": "plugins/language_tal.lua",
+ "id": "language_tal",
+ "mod_version": "3"
+ },
+ {
"description": "Syntax for the [Tcl](https://www.tcl.tk/) programming language",
"version": "0.1",
"path": "plugins/language_tcl.lua",
diff --git a/plugins/language_tal.lua b/plugins/language_tal.lua
new file mode 100644
index 0000000..aef83cd
--- /dev/null
+++ b/plugins/language_tal.lua
@@ -0,0 +1,70 @@
+--mod-version:3
+local syntax = require 'core.syntax'
+
+local label, sublabel = "function", "keyword2"
+
+syntax.add {
+ name = "Uxntal",
+ files = { "%.tal$" },
+ block_comment = { '(', ')' },
+ patterns = {
+ { pattern = {'%(', '%)'}, type = "comment" },
+ { pattern = "@%S*%s+%f[[]", type = label },
+ { pattern = "@%S+", type = "string" },
+ { pattern = "%u+()[2kr]*", type = { "symbol", "keyword" } },
+ { pattern = "%%%S+", type = "keyword" },
+ { pattern = "&%S+", type = sublabel },
+ { pattern = "\"%S+", type = "string" },
+ { pattern = "%.%S+()/%S*", type = { label, sublabel } },
+ { pattern = "%.%S+", type = label },
+ { pattern = "|%x+", type = "string" },
+ { pattern = "[.,;_=-]%S+", type = sublabel },
+ { pattern = "%$%d+", type = "number" },
+ { pattern = "#?%x%x%x%x%f[%X]", type = "number" },
+ { pattern = "#?%x%x%f[%X]", type = "number" },
+ { pattern = "[!?]()[^%[%]{}%s]+", type = { "operator", "function" } },
+ { pattern = "[^%[%]{}%s]+", type = "function" },
+ },
+ symbols = {
+ -- no mode keywords
+ ["JCI"] = "keyword",
+ ["JMI"] = "keyword",
+ ["JSI"] = "keyword",
+ ["BRK"] = "keyword",
+
+ -- lit only has 4 modes
+ ["LIT"] = "keyword",
+
+ -- the rest
+ ["EQU"] = "keyword",
+ ["LDZ"] = "keyword",
+ ["ADD"] = "keyword",
+ ["INC"] = "keyword",
+ ["NEQ"] = "keyword",
+ ["STZ"] = "keyword",
+ ["SUB"] = "keyword",
+ ["POP"] = "keyword",
+ ["GTH"] = "keyword",
+ ["LDR"] = "keyword",
+ ["MUL"] = "keyword",
+ ["NIP"] = "keyword",
+ ["LTH"] = "keyword",
+ ["STR"] = "keyword",
+ ["DIV"] = "keyword",
+ ["SWP"] = "keyword",
+ ["JMP"] = "keyword",
+ ["LDA"] = "keyword",
+ ["AND"] = "keyword",
+ ["ROT"] = "keyword",
+ ["JCN"] = "keyword",
+ ["STA"] = "keyword",
+ ["ORA"] = "keyword",
+ ["DUP"] = "keyword",
+ ["JSR"] = "keyword",
+ ["DEI"] = "keyword",
+ ["EOR"] = "keyword",
+ ["OVR"] = "keyword",
+ ["STH"] = "keyword",
+ ["DEO"] = "keyword",
+ ["SFT"] = "keyword",
+ }}