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

syntax.add({
	name = "Resonic whatsnew.txt",
	shortname = "resowntxt",
	author = "liqube",
	filenames = "whatsnew.txt",

	patterns = {
--		{ pattern = { "What's New.+", "\n" }, type = "comment"  },
		{ pattern = '"[^"\n]-"', type = "string", not_preceded_by = "%w", not_followed_by = "%w" },
		{ pattern = "'[^'\n]-'", type = "string", not_preceded_by = "%w", not_followed_by = "%w" },
		{ pattern = "`.-`", type = "string" },
		{ pattern = "%-%s+", type = "comment" },
		{ pattern = "Pro:%s", type = "preprocesor" },
		{ pattern = "%(reported:%s.-%)", type = "comment" },
		{ pattern = "%(suggested:%s.-%)", type = "comment" },
		{ pattern = "%(thanks:%s.-%)", type = "comment" },
		{ pattern = "%d+.%d+[%d.]-%s+%(%d+-%d+-%d+%)", type = "function" },
		{ pattern = "%a[^:]*:", type = "symbol", line_start = true },
--		{ pattern = "[%w%s]+:%s+", type = "symbol"   },
		{ pattern = "-?%d+[%d%.eE]*[c%%]?", type = "number" },
		{ pattern = "-?%.?%d+[c%%]?", type = "number" },
		{ pattern = "[^\n]*\n", type = "function", line_start = true, next_line = "^~~~~+%s*$" },
		{ pattern = "~~~+", type = "function" },
		{ pattern = "end of file.", type = "comment" },
	},

	outline_patterns = {
		{ pattern = "[^\n]*\n", line_start = true, next_line = "^~~~~+%s*$" },
	},
})
