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

syntax.add({
	name = "WebVTT Subtitles File",
	shortname = "WebVTT",
	author = "liqube",
	extensions = "vtt",
	headers = "^WEBVTT",

	patterns = {
		{ pattern = "WEBVTT", type = "meta", line_start = true },

		{ pattern = "Kind:%s*[^\n]*", type = "keyword", line_start = true },
		{ pattern = "Language:%s*[^\n]*", type = "keyword", line_start = true },
		{ pattern = "STYLE", type = "keyword", line_start = true },

		{ pattern = "%d%d:%d%d:%d%d%.%d%d%d", type = "symbol", line_start = true },
		{ pattern = "%-%->", type = "symbol" },
		{ pattern = "%d%d:%d%d:%d%d%.%d%d%d", type = "symbol" },
		{ pattern = "[%a_%-]+:%S+", type = "comment" },

		{ pattern = "%b[]", type = "function" },
		{ pattern = "<[^>\n]->", type = "comment" },
	},
	
	outline_patterns = {
		{ pattern = "%d%d:%d%d:%d%d%.%d%d%d%s+%-%->%s+%d%d:%d%d:%d%d%.%d%d%d", line_start = true },
	},
})
