#include <eepp/ui/doc/languages/zig.hpp>
#include <eepp/ui/doc/syntaxdefinitionmanager.hpp>

namespace EE { namespace UI { namespace Doc { namespace Language {

void addZig() {

	auto& sd = SyntaxDefinitionManager::instance()->add(

		{ "Zig",
		  { "%.zig$" },
		  {
			  { { "//.-\n" }, "comment" },
			  { { "\\\\.-\n" }, "string" },
			  { { "\"", "\"", "\\" }, "string" },
			  { { "'", "'", "\\" }, "string" },
			  { { "[iu][%d_]+" }, "keyword2" },
			  { { "0b[01_]+" }, "number" },
			  { { "0o[0-7_]+" }, "number" },
			  { { "0x[%x_]+" }, "number" },
			  { { "0x[%x_]+%.[%x_]*[pP][-+]?%d+" }, "number" },
			  { { "0x[%x_]+%.[%x_]*" }, "number" },
			  { { "0x%.[%x_]+[pP][-+]?%d+" }, "number" },
			  { { "0x%.[%x_]+" }, "number" },
			  { { "0x[%x_]+[pP][-+]?%d+" }, "number" },
			  { { "0x[%x_]+" }, "number" },
			  { { "%d[%d_]*%.[%d_]*[eE][-+]?%d+" }, "number" },
			  { { "%d[%d_]*%.[%d_]*" }, "number" },
			  { { "%d[%d_]*" }, "number" },
			  { { "[%+%-=/%*%^%%<>!~|&%.%?]" }, "operator" },
			  { { "([%a_][%w_]*)(%s*%()" }, { "function", "function", "normal" } },
			  { { "[A-Z][%w_]*" }, "keyword2" },
			  { { "[%a_][%w_]*" }, "symbol" },
			  { { "(@)([%a_][%w_]*)" }, { "operator", "operator", "function" } },

		  },
		  {
			  { "f64", "keyword2" },
			  { "enum", "keyword" },
			  { "noalias", "keyword" },
			  { "c_void", "keyword2" },
			  { "allowzero", "keyword" },
			  { "opaque", "keyword" },
			  { "c_uint", "keyword2" },
			  { "and", "keyword" },
			  { "f16", "keyword2" },
			  { "c_ulong", "keyword2" },
			  { "nakedcc", "keyword" },
			  { "error", "keyword" },
			  { "callconv", "keyword" },
			  { "test", "keyword" },
			  { "f32", "keyword2" },
			  { "const", "keyword" },
			  { "union", "keyword" },
			  { "nosuspend", "keyword" },
			  { "align", "keyword" },
			  { "anytype", "keyword" },
			  { "async", "keyword" },
			  { "return", "keyword" },
			  { "errdefer", "keyword" },
			  { "cancel", "keyword" },
			  { "undefined", "literal" },
			  { "true", "literal" },
			  { "usingnamespace", "keyword" },
			  { "void", "keyword2" },
			  { "volatile", "keyword" },
			  { "linksection", "keyword" },
			  { "threadlocal", "keyword" },
			  { "suspend", "keyword" },
			  { "struct", "keyword" },
			  { "comptime", "keyword" },
			  { "null", "literal" },
			  { "try", "keyword" },
			  { "bool", "keyword2" },
			  { "comptime_int", "keyword2" },
			  { "continue", "keyword" },
			  { "anyerror", "keyword2" },
			  { "type", "keyword2" },
			  { "c_longdouble", "keyword2" },
			  { "resume", "keyword" },
			  { "noreturn", "keyword2" },
			  { "c_ulonglong", "keyword2" },
			  { "c_long", "keyword2" },
			  { "c_int", "keyword2" },
			  { "c_longlong", "keyword2" },
			  { "c_ushort", "keyword2" },
			  { "c_short", "keyword2" },
			  { "noasync", "keyword" },
			  { "defer", "keyword" },
			  { "f128", "keyword2" },
			  { "else", "keyword" },
			  { "isize", "keyword2" },
			  { "break", "keyword" },
			  { "export", "keyword" },
			  { "packed", "keyword" },
			  { "extern", "keyword" },
			  { "fn", "keyword" },
			  { "if", "keyword" },
			  { "anyframe", "keyword" },
			  { "switch", "keyword" },
			  { "orelse", "keyword" },
			  { "usize", "keyword2" },
			  { "unreachable", "keyword" },
			  { "asm", "keyword" },
			  { "for", "keyword" },
			  { "while", "keyword" },
			  { "inline", "keyword" },
			  { "comptime_float", "keyword2" },
			  { "var", "keyword" },
			  { "catch", "keyword" },
			  { "or", "keyword" },
			  { "false", "literal" },
			  { "pub", "keyword" },
			  { "await", "keyword" },
			  { "ccc", "keyword" },
			  { "stdcallcc", "keyword" },

		  },
		  "//",
		  {}

		} );

	sd.setFoldRangeType( FoldRangeType::Braces ).setFoldBraces( { { '{', '}' } } );
}

}}}} // namespace EE::UI::Doc::Language
