aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_ini.lua
blob: df2a46f964110ed1fb994654bfae36db7351d57d (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
-- mod-version:3

local syntax = require "core.syntax"

syntax.add {
  name = "INI",
  files = { "%.ini$", "%.inf$", "%.cfg$", "%.editorconfig$", "%.theme$", "%.dockitem$" },
  comment = ';',
  patterns = {
    { pattern = ";.*", type = "comment" },
    { pattern = "#.*", type = "comment" },
    { pattern = { "%[", "%]" }, type = "keyword" },

    { pattern = { '"""', '"""', '\\' }, type = "string" },
    { pattern = { '"', '"', '\\' }, type = "string" },
    { pattern = { "'''", "'''" }, type = "string" },
    { pattern = { "'", "'" }, type = "string" },
    { pattern = "[A-Za-z0-9_%.%-]+%s*%f[=]", type = "function" },
    { pattern = "[%-+]?[0-9_]+%.[0-9_]+", type = "number" },
    { pattern = "[%-+]?[0-9_]+", type = "number" },
    { pattern = "[a-z]+", type = "symbol" },
  },
  symbols = {
    ["true"] = "literal",
    ["false"] = "literal",
  },
}