From d2a09e6c6b960d2b95398c92e73cad24f7d4993e Mon Sep 17 00:00:00 2001 From: ThaCuber <70547062+ThaCuber@users.noreply.github.com> Date: Sat, 20 May 2023 11:46:24 -0400 Subject: Added a bunch of languages (#251) * Add a bunch of language highlighters * ah shit, the manifest --- plugins/language_lox.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 plugins/language_lox.lua (limited to 'plugins/language_lox.lua') diff --git a/plugins/language_lox.lua b/plugins/language_lox.lua new file mode 100644 index 0000000..a6b3c43 --- /dev/null +++ b/plugins/language_lox.lua @@ -0,0 +1,34 @@ +-- mod-version:3 +local syntax = require 'core.syntax' + +syntax.add { + name = "Lox", + files = { "%.lox$" }, + comment = "//", + patterns = { + { pattern = "//.-\n", type = "comment" }, + { pattern = { '"', '"' }, type = "string" }, + { pattern = "%a[%w_]*()%s*%f[(]", type = {"function", "normal"} }, + { pattern = "[%a_][%w_]*%s*%f[(]", type = "function" }, + { pattern = "%d+%.?%d*", type = "number" }, + { pattern = "%a%w*", type = "symbol" }, + }, + symbols = { + ["and"] = "keyword", + ["class"] = "keyword", + ["else"] = "keyword", + ["false"] = "literal", + ["for"] = "keyword", + ["fun"] = "keyword", + ["if"] = "keyword", + ["nil"] = "literal", + ["or"] = "keyword", + ["print"] = "keyword", + ["return"] = "keyword", + ["super"] = "keyword2", + ["this"] = "keyword2", + ["true"] = "keyword", + ["var"] = "keyword", + ["while"] = "keyword", + }, +} -- cgit v1.2.3