aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkramo <93832451+kra-mo@users.noreply.github.com>2024-01-27 17:57:42 +0100
committerGitHub <noreply@github.com>2024-01-27 17:57:42 +0100
commit2c1147c4e144c3cb182438e1643f5546fc11186c (patch)
tree5e04a33ab8e539ff8c2039698bd453d0af82eeb9
parentbed1839e4f87a0b4862a2c07871a83fdc94d031e (diff)
downloadlite-xl-plugins-2c1147c4e144c3cb182438e1643f5546fc11186c.tar.gz
lite-xl-plugins-2c1147c4e144c3cb182438e1643f5546fc11186c.zip
Add `language_blueprint.lua` (#356)
* Add `language_blueprint.lua` * Bump `meta_languages` to 0.1.4
-rw-r--r--manifest.json11
-rw-r--r--plugins/language_blueprint.lua90
2 files changed, 100 insertions, 1 deletions
diff --git a/manifest.json b/manifest.json
index db89414..1a229f9 100644
--- a/manifest.json
+++ b/manifest.json
@@ -61,7 +61,7 @@
{
"id": "meta_languages",
"type": "meta",
- "version": "0.1.3",
+ "version": "0.1.4",
"mod_version": "3",
"description": "A metapackage containing all publically accessible language syntaxes.",
"dependencies": {
@@ -72,6 +72,7 @@
"language_batch": {},
"language_bib": {},
"language_blade": {},
+ "language_blueprint": {},
"language_c7": {},
"language_caddyfile": {},
"language_cmake": {},
@@ -600,6 +601,14 @@
"tags": ["language"]
},
{
+ "description": "Syntax for the [Blueprint](https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/) markup language",
+ "version": "0.1",
+ "path": "plugins/language_blueprint.lua",
+ "id": "language_blueprint",
+ "mod_version": "3",
+ "tags": ["language"]
+ },
+ {
"description": "Syntax for the modifications to [fe](https://github.com/rxi/fe/) used in [cel7](https://rxi.itch.io/cel7)",
"version": "0.1",
"path": "plugins/language_c7.lua",
diff --git a/plugins/language_blueprint.lua b/plugins/language_blueprint.lua
new file mode 100644
index 0000000..98d6b06
--- /dev/null
+++ b/plugins/language_blueprint.lua
@@ -0,0 +1,90 @@
+-- mod-version:3
+local syntax = require "core.syntax"
+
+syntax.add {
+ name = "Blueprint",
+ files = { "%.blp$", },
+ comment = "//",
+ block_comment = {"/*", "*/"},
+ patterns = {
+
+ -- Comments
+ { pattern = "//.*", type = "comment" },
+ { pattern = { "/%*", "%*/" }, type = "comment" },
+
+ -- Strings
+ { pattern = { "'", "'", "\\"}, type = "string" },
+ { pattern = { '"', '"', "\\" }, type = "string" },
+
+ -- Numbers
+ { pattern = "%.?%d+", type = "number" },
+
+ -- Child type
+ { pattern = "%[.*%]", type = "literal" },
+
+ -- Operators
+ { pattern = "%$", type = "operator" },
+ { pattern = "=>%s*%$().*()%(%)", type = { "operator", "function", "normal" } },
+
+ -- Properties
+ { pattern = "[%w-_]+()%s*:", type = { "keyword", "normal" } },
+
+ -- Classes
+ { pattern = "[%w_-%.]+%s*(){", type = { "keyword2", "normal"} },
+ { pattern = "[%w_-%.]+%s*()[%w_-]+%s*{", type = { "keyword2", "normal"} },
+
+ -- Symbols
+ { pattern = "[%w-_]+", type = "symbol" },
+
+ },
+ symbols = {
+ ["true"] = "literal",
+ ["false"] = "literal",
+ ["null"] = "literal",
+
+ -- Import statements
+ ["using"] = "keyword",
+
+ -- Keywords
+ ["after"] = "keyword",
+ ["bidirectional"] = "keyword",
+ ["bind-property"] = "keyword",
+ ["bind"] = "keyword",
+ ["default"] = "keyword",
+ ["destructive"] = "keyword",
+ ["disabled"] = "keyword",
+ ["inverted"] = "keyword",
+ ["no-sync-create"] = "keyword",
+ ["suggested"] = "keyword",
+ ["swapped"] = "keyword",
+ ["sync-create"] = "keyword",
+ ["template"] = "keyword",
+
+ -- Menus
+ ["menu"] = "keyword",
+ ["submenu"] = "keyword",
+ ["section"] = "keyword",
+
+ -- Nested blocks
+ ["responses"] = "keyword2",
+ ["items"] = "keyword2",
+ ["mime-types"] = "keyword2",
+ ["patterns"] = "keyword2",
+ ["suffixes"] = "keyword2",
+ ["marks"] = "keyword2",
+ ["widgets"] = "keyword2",
+ ["strings"] = "keyword2",
+ ["styles"] = "keyword2",
+ ["accessibility"] = "keyword2",
+ ["setters"] = "keyword2",
+ ["layout"] = "keyword2",
+ ["item"] = "keyword2",
+ ["condition"] = "keyword2",
+ ["mark"] = "keyword2",
+
+ -- Translated strings
+ ["_"] = "operator",
+ ["C_"] = "operator",
+ }
+}
+