-- lx-public:0

-- lx syntax
local syntax = require("core.syntax")

syntax.add({
  name = "Liqube Scut Command File",
  shortname = "Scut",
  extensions = { "x", "y" },
  comment = ";",

  patterns = {
    { pattern = ";.*", type = "comment" },
    { pattern = { '"', '"', "\\" }, type = "string" },
--  { pattern = "%s*@", type = { "function" } },
--  { pattern = "[%a_][%w_]*%f[%s]", type = "symbol" },
	{ pattern = "<[^>\r\n]+>", type = "keyword2" },
 	{ pattern = "%%[%a_][%w_]*%%", type = "symbol" }, -- %EnvironmentVars% (Windows-style)
	{ pattern = "(msgerror)%s+(.-)\n", type = { "keyword", "bold" } },
--    { pattern = "-?%d+[%d%.eE]*", type = "number" },
--    { pattern = "-?%.?%d+", type = "number" },
--    { pattern = "[%(%)]", type = "operator" },
--    { pattern = "[=,]", type = "operator" },
--    { pattern = "[%a_][%w_]*", type = "symbol" },
  },

  symbols = {
    -- Flow
    ["ifargs"] = "control",
    ["ifnoargs"] = "control",
    ["endif"] = "control",

    -- Execution
    ["run"] = "keyword",
    ["runexit"] = "keyword",
    ["runexit32"] = "keyword",
    ["runexit64"] = "keyword",
	["runexitamd64"] = "keyword",
	["runexit86"] = "keyword",

    -- Messaging
    ["msgerror"] = "keyword",

    -- Working dir
    ["path"] = "keyword",

    -- Window state
    ["max"] = "keyword",
    ["maximize"] = "keyword",
    ["min"] = "keyword",
    ["minimize"] = "keyword",

    -- Common macros
    ["exedir"] = "keyword2",
    ["curdir"] = "keyword2",
    ["cmdline"] = "keyword2",
    ["first"] = "keyword2",
    ["second"] = "keyword2",
    ["2nd"] = "keyword2",
    ["3rd"] = "keyword2",
  },
})
