From f18612d0bfea24547d52a189cb2613f3cc718e68 Mon Sep 17 00:00:00 2001 From: Aqil Contractor <32044067+AqilCont@users.noreply.github.com> Date: Sun, 21 Mar 2021 16:14:46 -0400 Subject: Add syntax highlighting for sass. --- plugins/language_sass.lua | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 plugins/language_sass.lua (limited to 'plugins/language_sass.lua') diff --git a/plugins/language_sass.lua b/plugins/language_sass.lua new file mode 100644 index 0000000..5b043c1 --- /dev/null +++ b/plugins/language_sass.lua @@ -0,0 +1,45 @@ +local syntax = require "core.syntax" + +syntax.add { + files = { "%.sass$" }, + comment = "//", + patterns = { + { pattern = "/[/%*].-\n", type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "$%w+", type = "keyword" }, + { pattern = "@%w+", type = "literal" }, + { pattern = "[#,]%w+", type = "function" }, + { pattern = "&", type = "keyword2" }, + { pattern = "[:%/%*%-]", type = "operator" }, + { pattern = "[%a][%w-]*%s*%f[:]", type = "keyword2" }, + { pattern = "-?%d+[%d%.]*p[xt]", type = "number" }, + { pattern = "-?%d+[%d%.]*deg", type = "number" }, + { pattern = "-?%d+[%d%.]*[s%%]", type = "number" }, + { pattern = "-?%d+[%d%.]*", type = "number" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, + }, + symbols = { + ["transparent"] = "literal", + ["none"] = "literal", + ["absolute"] = "literal", + ["relative"] = "literal", + ["solid"] = "literal", + ["flex"] = "literal", + ["flex-start"] = "literal", + ["flex-end"] = "literal", + ["row"] = "literal", + ["center"] = "literal", + ["column"] = "literal", + ["pointer"] = "literal", + ["ease"] = "literal", + ["white"] = "function", + ["black"] = "function", + ["gray"] = "function", + ["blue"] = "function", + ["red"] = "function", + ["purple"] = "function", + ["green"] = "function", + ["yellow"] = "function" + } +} -- cgit v1.2.3