2022-05-31 22:34:14 +02:00
|
|
|
-- mod-version:3
|
2019-12-28 12:16:32 +01:00
|
|
|
local syntax = require "core.syntax"
|
|
|
|
|
|
|
|
syntax.add {
|
2021-11-21 03:46:43 +01:00
|
|
|
name = "CSS",
|
2019-12-28 12:16:32 +01:00
|
|
|
files = { "%.css$" },
|
2021-12-26 08:05:27 +01:00
|
|
|
block_comment = { "/*", "*/" },
|
2019-12-28 12:16:32 +01:00
|
|
|
patterns = {
|
|
|
|
{ pattern = "\\.", type = "normal" },
|
|
|
|
{ pattern = "//.-\n", type = "comment" },
|
|
|
|
{ pattern = { "/%*", "%*/" }, type = "comment" },
|
|
|
|
{ pattern = { '"', '"', '\\' }, type = "string" },
|
|
|
|
{ pattern = { "'", "'", '\\' }, type = "string" },
|
|
|
|
{ pattern = "[%a][%w-]*%s*%f[:]", type = "keyword" },
|
2021-04-12 11:21:00 +02:00
|
|
|
{ pattern = "#%x%x%x%x%x%x%f[%W]",type = "string" },
|
|
|
|
{ pattern = "#%x%x%x%f[%W]", type = "string" },
|
2019-12-28 12:16:32 +01:00
|
|
|
{ pattern = "-?%d+[%d%.]*p[xt]", type = "number" },
|
|
|
|
{ pattern = "-?%d+[%d%.]*deg", type = "number" },
|
|
|
|
{ pattern = "-?%d+[%d%.]*", type = "number" },
|
|
|
|
{ pattern = "[%a_][%w_]*", type = "symbol" },
|
|
|
|
{ pattern = "#[%a][%w_-]*", type = "keyword2" },
|
|
|
|
{ pattern = "@[%a][%w_-]*", type = "keyword2" },
|
|
|
|
{ pattern = "%.[%a][%w_-]*", type = "keyword2" },
|
|
|
|
{ pattern = "[{}:]", type = "operator" },
|
|
|
|
},
|
|
|
|
symbols = {},
|
|
|
|
}
|