diff options
author | Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> | 2024-05-27 21:58:03 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-27 18:28:03 +0200 |
commit | d84b93dc69522d8103e6772da2cbefbd397163ab (patch) | |
tree | 54845ca58eea76e8759b0ba8f1d439783e6f1540 /plugins | |
parent | 8db08e2b5823a77f84f8f1598782bb5c249ef19b (diff) | |
download | lite-xl-plugins-d84b93dc69522d8103e6772da2cbefbd397163ab.tar.gz lite-xl-plugins-d84b93dc69522d8103e6772da2cbefbd397163ab.zip |
Add `language_bend` (#440)
* Create language_bend.lua
* Update manifest.json
* Update language_bend.lua
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
* Update manifest.json
---------
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/language_bend.lua | 65 |
1 files changed, 65 insertions, 0 deletions
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", + } +} |