aboutsummaryrefslogtreecommitdiff
path: root/data/plugins/language_css.lua
blob: 0c275da7edcb5d1bad8b02c3a1e9beed964ab684 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- mod-version:3
local syntax = require "core.syntax"

syntax.add {
  name = "CSS",
  files = { "%.css$" },
  block_comment = { "/*", "*/" },
  symbol_pattern = "[%a_%-#%.][%w_%-]*",
  symbol_non_word_chars = " \t\n/\\()\"':,;<>~!@$%^&*|+=[]{}`?",
  patterns = {
    { pattern = "\\.",                type = "normal"   },
    { pattern = "//.*",               type = "comment"  },
    { pattern = { "/%*", "%*/" },     type = "comment"  },
    { pattern = { '"', '"', '\\' },   type = "string"   },
    { pattern = { "'", "'", '\\' },   type = "string"   },
    { pattern = "[%a][%w-]*%s*%f[:]", type = "keyword"  },
    { pattern = "#%x%x%x%x%x%x%f[%W]",type = "string"   },
    { pattern = "#%x%x%x%f[%W]",      type = "string"   },
    { pattern = "-?%d+[%d%.]*p[xt]",  type = "number"   },
    { pattern = "-?%d+[%d%.]*deg",    type = "number"   },
    { pattern = "-?%d+[%d%.]*%%",     type = "number"   },
    { pattern = "-?%d+[%d%.]*",       type = "number"   },
    { pattern = "%-%-?[%a_][%w%-_]*", type = "constant" },
    { pattern = "[%a][%w%-]+%f[(]",   type = "function" },
    { pattern = "[%a_][%w%-_]*",      type = "symbol"   },
    { pattern = "#[%a][%w_-]*",       type = "keyword2" },
    { pattern = "@[%a][%w_-]*",       type = "keyword2" },
    { pattern = "%.[%a][%w_-]*",      type = "keyword2" },
    { pattern = "[{}:]",              type = "operator" },
  },
  symbols = {},
}