-- lx-public:0

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

format.register({
	name = "Liqube Qson Document",
	shortname = "liqubeqs",
	author = "liqube",
	created = "2020-05-16",
	extensions = { "qs", "qson" },
	comment = "//",

	patterns = {
		{ pattern = ";.-\n", type = "comment" },
		{ pattern = "//.-\n", type = "comment" },
		{ pattern = { "/%*", "%*/" }, type = "comment" },
		{ pattern = { '"', '"', "" }, type = "string" }, -- no escape char needed
		{ pattern = { "'", "'", "" }, type = "string" }, -- no escape char needed
		{ pattern = "0x[%da-fA-F]+", type = "number" },
		{ pattern = "0b[01]+", type = "number" },
		{ pattern = "-?%d+[%d%.eE]*", type = "number" },
		{ pattern = "-?%.?%d+", type = "number" },
		{ pattern = "[{}%[%],]", type = "operator" },
		{ pattern = { "@.-", " " }, type = "keyword" },
		{ pattern = "[%a_][%w_]*", type = "normal" },
	},

	symbols = {
		["true"] = "literal",
		["false"] = "literal",
		["yes"] = "literal",
		["no"] = "literal",
		["null"] = "literal",
	},
})
