-- lx format
local format = require("core.format")
local sln_references = require("format.sln.references")

format.register({
	name = "Visual Studio Solution",
	shortname = "Solution",
	author = "liqube",
	created = "2020-05-16",
	extensions = "sln",
	comment = "#",
	file_references = sln_references.new(),

	patterns = {
		{ pattern = "Microsoft Visual Studio Solution File.-\n", type = "comment" },
		{ pattern = "#.-\n", type = "comment" }, -- comments
		{ pattern = "%{%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x%}", type = "symbol" },
		-- guids
		{ pattern = "-?%.?%d+f?", type = "number" }, -- numbers
		{ pattern = "[%|()=,%.]", type = "operator" }, -- operators
		{ pattern = { '"', '"', "\\" }, type = "string" }, -- strings
		{ pattern = "[%a_][%w_]*", type = "normal" },
	},

	symbols = {
		["Project"] = "function",
		["EndProject"] = "function",
		["ProjectSection"] = "keyword",
		["EndProjectSection"] = "keyword",
		["Global"] = "function",
		["EndGlobal"] = "function",
		["GlobalSection"] = "keyword",
		["EndGlobalSection"] = "keyword",
		["ActiveCfg"] = "keyword2",
		["Build"] = "keyword2",
		["FALSE"] = "literal",
		["TRUE"] = "literal",
	},
})
