aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifest.json13
-rw-r--r--plugins/language_bend.lua65
2 files changed, 77 insertions, 1 deletions
diff --git a/manifest.json b/manifest.json
index 29490ab..f5bf49a 100644
--- a/manifest.json
+++ b/manifest.json
@@ -66,6 +66,7 @@
"language_autohotkey_v1": {},
"language_batch": {},
"language_bazel": {},
+ "language_bend": {},
"language_bib": {},
"language_blade": {},
"language_blueprint": {},
@@ -165,7 +166,7 @@
"id": "meta_languages",
"mod_version": "3",
"type": "meta",
- "version": "0.1.15"
+ "version": "0.1.16"
},
{
"description": "Align multiple carets and selections *([clip](https://user-images.githubusercontent.com/2798487/165631951-532f8d24-d596-4dd0-9d21-ff53c71ed32f.mp4))*",
@@ -682,6 +683,16 @@
"version": "0.1"
},
{
+ "description": "Syntax for [Bend](https://higherorderco.com/) programming language files.",
+ "id": "language_bend",
+ "mod_version": "3",
+ "path": "plugins/language_bend.lua",
+ "tags": [
+ "language"
+ ],
+ "version": "0.1"
+ },
+ {
"description": "Syntax for [BibTex](https://en.wikipedia.org/wiki/BibTeX) files",
"id": "language_bib",
"mod_version": "3",
diff --git a/plugins/language_bend.lua b/plugins/language_bend.lua
new file mode 100644
index 0000000..5792084
--- /dev/null
+++ b/plugins/language_bend.lua
@@ -0,0 +1,65 @@
+-- Author: Rohan Vashisht https://github.com/RohanVashisht1234
+
+-- mod-version:3
+
+local syntax = require "core.syntax"
+
+syntax.add {
+ name = "Bend",
+ files = { "%.bend$" },
+ comment = "#",
+ patterns = {
+ { pattern = "#.*", type = "comment" },
+ { pattern = { '"', '"' }, type = "string" },
+ { pattern = { "'", "'" }, type = "string" },
+ { pattern = "[%a_][%w_]*%f[(]", type = "function" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ { pattern = "[%+%-=/%*%^%%<>!|&]", type = "operator" },
+ { pattern = "def()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "data()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "let()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "Some()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "bend()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "object()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "fold()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "open()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "do()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "identity()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "lambda()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "0x[%da-fA-F]+", type = "number" },
+ { pattern = "-?%d+[%d%.eE]*", type = "number" },
+ { pattern = "-?%.?%d+", type = "number" },
+ },
+ symbols = {
+ ["def"] = "keyword",
+ ["switch"] = "keyword",
+ ["case"] = "keyword",
+ ["return"] = "keyword",
+ ["if"] = "keyword",
+ ["else"] = "keyword",
+ ["when"] = "keyword",
+ ["match"] = "keyword",
+ ["λ"] = "keyword",
+ ["Some"] = "keyword",
+ ["data"] = "keyword",
+ ["let"] = "keyword",
+ ["use"] = "keyword",
+ ["object"] = "keyword",
+ ["fold"] = "keyword",
+ ["open"] = "keyword",
+ ["do"] = "keyword",
+ ["bind"] = "keyword",
+ ["Name"] = "keyword",
+ ["identity"] = "keyword",
+ ["Bool"] = "keyword",
+ ["ask"] = "keyword",
+ ["with"] = "keyword",
+ ["bend"] = "keyword2",
+ ["None"] = "keyword2",
+ ["Nil"] = "keyword2",
+ ["Result"] = "keyword2",
+ ["type"] = "keyword2",
+ ["true"] = "literal",
+ ["false"] = "literal",
+ }
+}