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

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

SyntaxDefinition& addHLSL() {

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

		{ "HLSL",
		  {
			  "%.hlsl$",
		  },
		  {
			  { { "//.-\n" }, "comment" },
			  { { "/%*", "%*/" }, "comment" },
			  { { "#", "\n" }, "comment" },
			  { { "\"", "\"", "\\" }, "string" },
			  { { "'", "'", "\\" }, "string" },
			  { { "-?0x%x+" }, "number" },
			  { { "-?%d+[%d%.eE]*f?" }, "number" },
			  { { "-?%.?%d+f?" }, "number" },
			  { { "[%+%-=/%*%^%%<>!~|&]" }, "operator" },
			  { { "int[1-9]x[1-9]" }, "type" },
			  { { "int1[0-6]x[1-9]" }, "type" },
			  { { "int[1-9]x1[0-6]" }, "type" },
			  { { "int1[0-6]x1[0-6]" }, "type" },
			  { { "int[1-4]" }, "type" },
			  { { "uint[1-9]x[1-9]" }, "type" },
			  { { "uint1[0-6]x[1-9]" }, "type" },
			  { { "uint[1-9]x1[0-6]" }, "type" },
			  { { "uint1[0-6]x1[0-6]" }, "type" },
			  { { "uint[1-4]" }, "type" },
			  { { "dword[1-9]x[1-9]" }, "type" },
			  { { "dword1[0-6]x[1-9]" }, "type" },
			  { { "dword[1-9]x1[0-6]" }, "type" },
			  { { "dword1[0-6]x1[0-6]" }, "type" },
			  { { "dword[1-4]" }, "type" },
			  { { "half[1-9]x[1-9]" }, "type" },
			  { { "half1[0-6]x[1-9]" }, "type" },
			  { { "half[1-9]x1[0-6]" }, "type" },
			  { { "half1[0-6]x1[0-6]" }, "type" },
			  { { "half[1-4]" }, "type" },
			  { { "float[1-9]x[1-9]" }, "type" },
			  { { "float1[0-6]x[1-9]" }, "type" },
			  { { "float[1-9]x1[0-6]" }, "type" },
			  { { "float1[0-6]x1[0-6]" }, "type" },
			  { { "float[1-4]" }, "type" },
			  { { "double[1-9]x[1-9]" }, "type" },
			  { { "double1[0-6]x[1-9]" }, "type" },
			  { { "double[1-9]x1[0-6]" }, "type" },
			  { { "double1[0-6]x1[0-6]" }, "type" },
			  { { "double[1-4]" }, "type" },
			  { { "[%a_][%w_]*%f[(]" }, "function" },
			  { { "[%a_][%w_]*" }, "symbol" },
		  },
		  {
			  { "AppendStructuredBuffer", "keyword" },
			  { "asm", "keyword" },
			  { "asm_fragment", "keyword" },
			  { "BlendState", "type" },
			  { "bool", "type" },
			  { "break", "keyword" },
			  { "Buffer", "type" },
			  { "ByteAddressBuffer", "type" },
			  { "case", "keyword" },
			  { "cbuffer", "type" },
			  { "centroid", "type" },
			  { "class", "keyword" },
			  { "column_major", "keyword" },
			  { "compile", "keyword" },
			  { "compile_fragment", "keyword" },
			  { "CompileShader", "keyword" },
			  { "const", "keyword" },
			  { "continue", "keyword" },
			  { "ComputeShader", "keyword" },
			  { "ConsumeStructuredBuffer", "keyword" },
			  { "default", "keyword" },
			  { "DepthStencilState", "keyword" },
			  { "DepthStencilView", "keyword" },
			  { "discard", "keyword" },
			  { "do", "keyword" },
			  { "double", "type" },
			  { "DomainShader", "type" },
			  { "dword", "type" },
			  { "else", "keyword" },
			  { "export", "keyword" },
			  { "extern", "keyword" },
			  { "false", "literal" },
			  { "float", "type" },
			  { "for", "keyword" },
			  { "fxgroup", "type" },
			  { "GeometryShader", "type" },
			  { "groupshared", "keyword" },
			  { "half", "type" },
			  { "HullShader", "type" },
			  { "if", "keyword" },
			  { "in", "keyword" },
			  { "inline", "keyword" },
			  { "inout", "keyword" },
			  { "InputPatch", "type" },
			  { "int", "type" },
			  { "interface", "keyword" },
			  { "line", "type" },
			  { "lineadj", "type" },
			  { "linear", "keyword" },
			  { "LineStream", "type" },
			  { "matrix", "type" },
			  { "min16float", "type" },
			  { "min10float", "type" },
			  { "min16int", "type" },
			  { "min12int", "type" },
			  { "min16uint", "type" },
			  { "namespace", "keyword" },
			  { "nointerpolation", "keyword" },
			  { "noperspective", "keyword" },
			  { "NULL", "literal" },
			  { "out", "keyword" },
			  { "OutputPatch", "type" },
			  { "packoffset", "keyword" },
			  { "pass", "keyword" },
			  { "pixelfragment", "keyword" },
			  { "PixelShader", "type" },
			  { "point", "type" },
			  { "PointStream", "type" },
			  { "precise", "keyword" },
			  { "RasterizerState", "type" },
			  { "RenderTargetView", "type" },
			  { "return", "keyword" },
			  { "register", "keyword" },
			  { "row_major", "keyword" },
			  { "RWBuffer", "type" },
			  { "RWByteAddressBuffer", "type" },
			  { "RWStructuredBuffer", "type" },
			  { "RWTexture1D", "type" },
			  { "RWTexture1DArray", "type" },
			  { "RWTexture2D", "type" },
			  { "RWTexture2DArray", "type" },
			  { "RWTexture3D", "type" },
			  { "sample", "keyword" },
			  { "sampler", "type" },
			  { "SamplerState", "type" },
			  { "SamplerComparisonState", "type" },
			  { "shared", "keyword" },
			  { "snorm", "keyword" },
			  { "stateblock", "keyword" },
			  { "stateblock_state", "keyword" },
			  { "static", "keyword" },
			  { "string", "type" },
			  { "struct", "keyword" },
			  { "switch", "keyword" },
			  { "StructuredBuffer", "type" },
			  { "tbuffer", "type" },
			  { "technique", "type" },
			  { "technique10", "type" },
			  { "technique11", "type" },
			  { "texture", "type" },
			  { "Texture1D", "type" },
			  { "Texture1DArray", "type" },
			  { "Texture2D", "type" },
			  { "Texture2DArray", "type" },
			  { "Texture2DMS", "type" },
			  { "Texture2DMSArray", "type" },
			  { "Texture3D", "type" },
			  { "TextureCube", "type" },
			  { "TextureCubeArray", "type" },
			  { "true", "literal" },
			  { "typedef", "keyword" },
			  { "triangle", "type" },
			  { "triangleadj", "type" },
			  { "TriangleStream", "type" },
			  { "uint", "type" },
			  { "uniform", "keyword" },
			  { "unorm", "keyword" },
			  { "unsigned", "keyword" },
			  { "vector", "type" },
			  { "vertexfragment", "type" },
			  { "VertexShader", "type" },
			  { "void", "keyword" },
			  { "volatile", "keyword" },
			  { "while", "keyword" },
			  { "abort", "keyword" },
			  { "abs", "keyword" },
			  { "acos", "keyword" },
			  { "all", "keyword" },
			  { "any", "keyword" },
			  { "asdouble", "keyword" },
			  { "asfloat", "keyword" },
			  { "asin", "keyword" },
			  { "asint", "keyword" },
			  { "asuint", "keyword" },
			  { "atan", "keyword" },
			  { "atan2", "keyword" },
			  { "ceil", "keyword" },
			  { "clamp", "keyword" },
			  { "clip", "keyword" },
			  { "cos", "keyword" },
			  { "cosh", "keyword" },
			  { "countbits", "keyword" },
			  { "cross", "keyword" },
			  { "ddx", "keyword" },
			  { "ddx_coarse", "keyword" },
			  { "ddx_fine", "keyword" },
			  { "ddy", "keyword" },
			  { "ddy_coarse", "keyword" },
			  { "ddy_fine", "keyword" },
			  { "degrees", "keyword" },
			  { "determinant", "keyword" },
			  { "distance", "keyword" },
			  { "dot", "keyword" },
			  { "dst", "keyword" },
			  { "errorf", "keyword" },
			  { "exp", "keyword" },
			  { "exp2", "keyword" },
			  { "f16tof32", "keyword" },
			  { "f32tof16", "keyword" },
			  { "faceforward", "keyword" },
			  { "firstbithigh", "keyword" },
			  { "firstbitlow", "keyword" },
			  { "floor", "keyword" },
			  { "fma", "keyword" },
			  { "fmod", "keyword" },
			  { "frac", "keyword" },
			  { "frexp", "keyword" },
			  { "fwidth", "keyword" },
			  { "isfinite", "keyword" },
			  { "isinf", "keyword" },
			  { "isnan", "keyword" },
			  { "ldexp", "keyword" },
			  { "length", "keyword" },
			  { "lerp", "keyword" },
			  { "lit", "keyword" },
			  { "log", "keyword" },
			  { "log10", "keyword" },
			  { "log2", "keyword" },
			  { "mad", "keyword" },
			  { "max", "keyword" },
			  { "min", "keyword" },
			  { "modf", "keyword" },
			  { "msad4", "keyword" },
			  { "mul", "keyword" },
			  { "noise", "keyword" },
			  { "normalize", "keyword" },
			  { "pow", "keyword" },
			  { "printf", "keyword" },
			  { "radians", "keyword" },
			  { "rcp", "keyword" },
			  { "reflect", "keyword" },
			  { "refract", "keyword" },
			  { "reversebits", "keyword" },
			  { "round", "keyword" },
			  { "rsqrt", "keyword" },
			  { "saturate", "keyword" },
			  { "sign", "keyword" },
			  { "sin", "keyword" },
			  { "sincos", "keyword" },
			  { "sinh", "keyword" },
			  { "smoothstep", "keyword" },
			  { "sqrt", "keyword" },
			  { "step", "keyword" },
			  { "tan", "keyword" },
			  { "tanh", "keyword" },
			  { "transpose", "keyword" },
			  { "trunc", "keyword" },
		  },
		  "//" } );

	sd.setFoldRangeType( FoldRangeType::Braces ).setFoldBraces( { { '{', '}' } } );
	sd.setBlockComment( { "/*", "*/" } );
	return sd;
}

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