From 8e3fab7edcf278bd9361a265cced41f8f2a0eec5 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Tue, 21 Mar 2023 15:28:48 +0100 Subject: Move `language_blade` to correct location --- plugins/language_blade.lua | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 plugins/language_blade.lua (limited to 'plugins/language_blade.lua') diff --git a/plugins/language_blade.lua b/plugins/language_blade.lua new file mode 100644 index 0000000..0b82387 --- /dev/null +++ b/plugins/language_blade.lua @@ -0,0 +1,57 @@ +-- mod-version:3 +local syntax = require "core.syntax" + +syntax.add { + name = "Blade", + files = { "%.b$" }, + comment = "#", + patterns = { + { pattern = "#.*", type = "comment" }, + { pattern = { "/%*", "%*/" }, type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "%d+%.%d+", type = "number" }, + { pattern = "0x%x+", type = "number" }, + { pattern = "0c[0-8]+", type = "number" }, + { pattern = "0c[01]+", type = "number" }, + { pattern = "%d+", type = "number" }, + { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "%a[%w_]+", type = "symbol" }, + }, + -- https://bladelang.com/tutorial/reserved.html#reserved-words + symbols = { + ["and"] = "keyword", + ["continue"] = "keyword", + ["else"] = "keyword", + ["in"] = "keyword", + ["self"] = "keyword2", + ["when"] = "keyword", + ["as"] = "keyword", + ["def"] = "keyword", + ["iter"] = "keyword", + ["static"] = "keyword", + ["while"] = "keyword", + ["assert"] = "keyword", + ["default"] = "keyword", + ["finally"] = "keyword", + ["break"] = "keyword", + ["die"] = "keyword", + ["for"] = "keyword", + ["or"] = "keyword", + ["try"] = "keyword", + ["catch"] = "keyword", + ["do"] = "keyword", + ["if"] = "keyword", + ["parent"] = "keyword", + ["using"] = "keyword", + ["class"] = "keyword", + ["echo"] = "function", + ["import"] = "keyword", + ["return"] = "keyword", + ["var"] = "keyword", + ["true"] = "literal", + ["false"] = "literal", + ["nil"] = "literal", + }, +} -- cgit v1.2.3