aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-05-26 09:29:04 +0100
committerGitHub <noreply@github.com>2020-05-26 09:29:04 +0100
commited3242d4751a67055f307afd3d605de56c2d3be8 (patch)
tree54aaf5022b15e8f832de2e75e7a2a5082c154ce1
parenta6056db6510565af2d04b95af486fe033ab7376a (diff)
parent9c35558bf17e3da81f249db4c9a93b7178959482 (diff)
downloadlite-xl-plugins-ed3242d4751a67055f307afd3d605de56c2d3be8.tar.gz
lite-xl-plugins-ed3242d4751a67055f307afd3d605de56c2d3be8.zip
Merge pull request #46 from alexGuntha/master
language_glsl and language_hlsl plugins
-rw-r--r--README.md2
-rw-r--r--plugins/language_glsl.lua387
-rw-r--r--plugins/language_hlsl.lua275
3 files changed, 664 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4c503b5..a59b28d 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,9 @@ Plugin | Description
[`language_fe`](plugins/language_fe.lua?raw=1) | Syntax for the [fe](https://github.com/rxi/fe) programming language
[`language_fennel`](plugins/language_fennel.lua?raw=1) | Syntax for the [fennel](https://fennel-lang.org) programming language
[`language_gdscript`](plugins/language_gdscript.lua?raw=1) | Syntax for the [Godot Engine](https://godotengine.org/)'s GDScript scripting language
+[`language_glsl`](plugins/language_glsl.lua?raw=1) | Syntax for the [GLSL](https://www.khronos.org/registry/OpenGL/specs/gl/) programming language
[`language_go`](plugins/language_go.lua?raw=1) | Syntax for the [Go](https://golang.org/) programming language
+[`language_hlsl`](plugins/language_hlsl.lua?raw=1) | Syntax for the [HLSL](https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl) programming language
[`language_hs`](plugins/language_hs.lua?raw=1) | Syntax for the [Haskell](https://www.haskell.org/) programming language
[`language_jiyu`](plugins/language_jiyu.lua?raw=1) | Syntax for the [jiyu](https://github.com/machinamentum/jiyu) programming language
[`language_odin`](plugins/language_odin.lua?raw=1) | Syntax for the [Odin](https://github.com/odin-lang/Odin) programming language
diff --git a/plugins/language_glsl.lua b/plugins/language_glsl.lua
new file mode 100644
index 0000000..da69ebd
--- /dev/null
+++ b/plugins/language_glsl.lua
@@ -0,0 +1,387 @@
+
+local style = require "core.style"
+local common = require "core.common"
+
+local syntax = require "core.syntax"
+
+syntax.add {
+ files = { "%.glsl$", "%.frag$", "%.vert$", },
+ comment = "//",
+ patterns = {
+ { pattern = "//.-\n", type = "comment" },
+ { pattern = { "/%*", "%*/" }, type = "comment" },
+ { pattern = { "#", "[^\\]\n" }, type = "comment" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "'", "'", '\\' }, type = "string" },
+ { pattern = "-?0x%x+", type = "number" },
+ { pattern = "-?%d+[%d%.eE]*f?", type = "number" },
+ { pattern = "-?%.?%d+f?", type = "number" },
+ { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
+
+ { pattern = "ivec[2-4]", type = "keyword2" },
+ { pattern = "bvec[2-4]", type = "keyword2" },
+ { pattern = "uvec[2-4]", type = "keyword2" },
+ { pattern = "vec[2-4]", type = "keyword2" },
+ { pattern = "dmat[2-4]x[2-4]", type = "keyword2" },
+ { pattern = "dmat[2-4]", type = "keyword2" },
+ { pattern = "mat[2-4]x[2-4]", type = "keyword2" },
+ { pattern = "mat[2-4]", type = "keyword2" },
+
+ { pattern = "[%a_][%w_]*%f[(]", type = "function" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ },
+ symbols = {
+ --https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.pdf
+ --The symbols are added here in the order they appear in the spec
+ ["if"] = "keyword",
+ ["else"] = "keyword",
+ ["do"] = "keyword",
+ ["while"] = "keyword",
+ ["for"] = "keyword",
+ ["break"] = "keyword",
+ ["continue"] = "keyword",
+ ["return"] = "keyword",
+ ["const"] = "keyword",
+ ["switch"] = "keyword",
+ ["case"] = "keyword",
+ ["default"] = "keyword",
+ ["const"] = "keyword",
+ ["void"] = "keyword",
+ ["bool"] = "keyword2",
+ ["int"] = "keyword2",
+ ["uint"] = "keyword2",
+ ["float"] = "keyword2",
+ ["double"] = "keyword2",
+ ["true"] = "literal",
+ ["false"] = "literal",
+ ["NULL"] = "literal",
+
+ ["attribute"] = "keyword",
+ ["varying"] = "keyword",
+ ["uniform"] = "keyword",
+ ["buffer"] = "keyword",
+ ["shared"] = "keyword",
+ ["layout"] = "keyword",
+ ["centroid"] = "keyword",
+ ["flat"] = "keyword",
+ ["smooth"] = "keyword",
+ ["noperspective"]= "keyword",
+ ["patch"] = "keyword",
+ ["sample"] = "keyword",
+ ["in"] = "keyword",
+ ["out"] = "keyword",
+ ["inout"] = "keyword",
+ ["invariant"] = "keyword",
+ ["precise"] = "keyword",
+ ["lowp"] = "keyword",
+ ["mediump"] = "keyword",
+ ["highp"] = "keyword",
+ ["precision"] = "keyword",
+ ["struct"] = "keyword",
+ ["subroutine"] = "keyword",
+
+ ["coherent"] = "keyword",
+ ["volatile"] = "keyword",
+ ["readonly"] = "keyword",
+ ["writeonly"] = "keyword",
+
+ ["sampler1D"] = "keyword2",
+ ["sampler2D"] = "keyword2",
+ ["sampler3D"] = "keyword2",
+ ["samplerCube"] = "keyword2",
+ ["sampler1DShadow"] = "keyword2",
+ ["sampler2DShadow"] = "keyword2",
+ ["samplerCubeShadow"] = "keyword2",
+ ["sampler1DArray"] = "keyword2",
+ ["sampler2DArray"] = "keyword2",
+ ["samplerCubeArray"] = "keyword2",
+ ["sampler1DArrayShadow"] = "keyword2",
+ ["sampler2DArrayShadow"] = "keyword2",
+ ["samplerCubeArrayShadow"]= "keyword2",
+ ["isampler1D"] = "keyword2",
+ ["isampler2D"] = "keyword2",
+ ["isampler3D"] = "keyword2",
+ ["isamplerCube"] = "keyword2",
+ ["sampler2DMS"] = "keyword2",
+ ["isampler2DMS"] = "keyword2",
+ ["usampler2DMS"] = "keyword2",
+ ["sampler2DMSArray"] = "keyword2",
+ ["isampler2DMSArray"] = "keyword2",
+ ["usampler2DMSArray"] = "keyword2",
+ ["isampler1DArray"] = "keyword2",
+ ["isampler2DArray"] = "keyword2",
+ ["usampler1D"] = "keyword2",
+ ["usampler2D"] = "keyword2",
+ ["usampler3D"] = "keyword2",
+ ["usamplerCube"] = "keyword2",
+ ["usampler1DArray"] = "keyword2",
+ ["usampler2DArray"] = "keyword2",
+ ["sampler2DRect"] = "keyword2",
+ ["sampler2DRectShadow"] = "keyword2",
+ ["isampler2DRect"] = "keyword2",
+ ["usampler2DRect"] = "keyword2",
+ ["samplerBuffer"] = "keyword2",
+ ["isamplerBuffer"] = "keyword2",
+ ["usamplerBuffer"] = "keyword2",
+
+ ["image1D"] = "keyword2",
+ ["iimage1D"] = "keyword2",
+ ["uimage1D"] = "keyword2",
+ ["image1DArray"] = "keyword2",
+ ["iimage1DArray"] = "keyword2",
+ ["uimage1DArray"] = "keyword2",
+ ["image2D"] = "keyword2",
+ ["iimage2D"] = "keyword2",
+ ["uimage2D"] = "keyword2",
+ ["image2DArray"] = "keyword2",
+ ["iimage2DArray"] = "keyword2",
+ ["uimage2DArray"] = "keyword2",
+ ["image2DRect"] = "keyword2",
+ ["iimage2DRect"] = "keyword2",
+ ["uimage2DRect"] = "keyword2",
+ ["image2DMS"] = "keyword2",
+ ["iimage2DMS"] = "keyword2",
+ ["uimage2DMS"] = "keyword2",
+ ["image2DMSArray"] = "keyword2",
+ ["iimage2DMSArray"]= "keyword2",
+ ["uimage2DMSArray"]= "keyword2",
+ ["image3D"] = "keyword2",
+ ["iimage3D"] = "keyword2",
+ ["uimage3D"] = "keyword2",
+ ["imageCube"] = "keyword2",
+ ["iimageCube"] = "keyword2",
+ ["uimageCube"] = "keyword2",
+ ["imageCubeArray"] = "keyword2",
+ ["iimageCubeArray"]= "keyword2",
+ ["uimageCubeArray"]= "keyword2",
+ ["imageBuffer"] = "keyword2",
+ ["iimageBuffer"] = "keyword2",
+ ["uimageBuffer"] = "keyword2",
+
+ ["atomic_uint"] = "keyword2",
+
+ ["radians"] = "keyword",
+ ["degrees"] = "keyword",
+ ["sin"] = "keyword",
+ ["cos"] = "keyword",
+ ["tan"] = "keyword",
+ ["asin"] = "keyword",
+ ["acos"] = "keyword",
+ ["atan"] = "keyword",
+ ["sinh"] = "keyword",
+ ["cosh"] = "keyword",
+ ["tanh"] = "keyword",
+ ["asinh"] = "keyword",
+ ["acosh"] = "keyword",
+ ["pow"] = "keyword",
+ ["exp"] = "keyword",
+ ["exp2"] = "keyword",
+ ["log2"] = "keyword",
+ ["sqrt"] = "keyword",
+ ["inversesqrt"] = "keyword",
+ ["abs"] = "keyword",
+ ["sign"] = "keyword",
+ ["floor"] = "keyword",
+ ["trunc"] = "keyword",
+ ["round"] = "keyword",
+ ["roundEven"] = "keyword",
+ ["ceil"] = "keyword",
+ ["fract"] = "keyword",
+ ["mod"] = "keyword",
+ ["modf"] = "keyword",
+ ["min"] = "keyword",
+ ["max"] = "keyword",
+ ["clamp"] = "keyword",
+ ["mix"] = "keyword",
+ ["step"] = "keyword",
+ ["smoothstep"] = "keyword",
+ ["isnan"] = "keyword",
+ ["isinf"] = "keyword",
+ ["floatBitsToInt"] = "keyword",
+ ["floatBitsToUint"] = "keyword",
+ ["intBitsToFloat"] = "keyword",
+ ["uintBitsToFloat"] = "keyword",
+ ["fma"] = "keyword",
+ ["frexp"] = "keyword",
+ ["ldexp"] = "keyword",
+ ["packUnorm2x16"] = "keyword",
+ ["packSnorm2x16"] = "keyword",
+ ["packUnorm4x8"] = "keyword",
+ ["packSnorm4x8"] = "keyword",
+ ["unpackUnorm2x16"] = "keyword",
+ ["unpackSnorm2x16"] = "keyword",
+ ["unpackUnorm4x8"] = "keyword",
+ ["unpackSnorm4x8"] = "keyword",
+ ["packHalf2x16"] = "keyword",
+ ["unpackHalf2x16"] = "keyword",
+ ["packDouble2x32"] = "keyword",
+ ["unpackDouble2x32"] = "keyword",
+ ["length"] = "keyword",
+ ["distance"] = "keyword",
+ ["dot"] = "keyword",
+ ["cross"] = "keyword",
+ ["normalize"] = "keyword",
+ ["ftransform"] = "keyword",
+ ["faceforward"] = "keyword",
+ ["reflect"] = "keyword",
+ ["refract"] = "keyword",
+ ["matrixCompMult"] = "keyword",
+ ["outerProduct"] = "keyword",
+ ["transpose"] = "keyword",
+ ["determinant"] = "keyword",
+ ["inverse"] = "keyword",
+ ["lessThan"] = "keyword",
+ ["lessThanEqual"] = "keyword",
+ ["greaterThan"] = "keyword",
+ ["greaterThanEqual"] = "keyword",
+ ["equal"] = "keyword",
+ ["notEqual"] = "keyword",
+ ["any"] = "keyword",
+ ["all"] = "keyword",
+ ["not"] = "keyword",
+ ["uaddCarry"] = "keyword",
+ ["usubBorrow"] = "keyword",
+ ["umulExtended"] = "keyword",
+ ["imulExtended"] = "keyword",
+ ["bitfieldExtract"] = "keyword",
+ ["bitfieldInsert"] = "keyword",
+ ["bitfieldReverse"] = "keyword",
+ ["bitCount"] = "keyword",
+ ["findLSB"] = "keyword",
+ ["findMSB"] = "keyword",
+ ["textureSize"] = "keyword",
+ ["textureQueryLod"] = "keyword",
+ ["textureQueryLevels"] = "keyword",
+ ["textureSamples"] = "keyword",
+ ["texture"] = "keyword",
+ ["textureProj"] = "keyword",
+ ["textureLod"] = "keyword",
+ ["textureOffset"] = "keyword",
+ ["texelFetch"] = "keyword",
+ ["texelFetchOffset"] = "keyword",
+ ["textureProjOffset"] = "keyword",
+ ["textureLodOffset"] = "keyword",
+ ["textureProjLod"] = "keyword",
+ ["textureProjLodOffset"] = "keyword",
+ ["textureGrad"] = "keyword",
+ ["textureGradOffset"] = "keyword",
+ ["textureProjGrad"] = "keyword",
+ ["textureProjGradOffset"]= "keyword",
+ ["textureGather"] = "keyword",
+ ["textureGatherOffset"] = "keyword",
+ ["textureGatherOffsets"] = "keyword",
+
+ --Atomic Counter Functions
+ ["atomicCounterIncrement"]= "keyword",
+ ["atomicCounterDecrement"]= "keyword",
+ ["atomicCounter"] = "keyword",
+ ["atomicCounterAdd"] = "keyword",
+ ["atomicCounterSubtract"] = "keyword",
+ ["atomicCounterMin"] = "keyword",
+ ["atomicCounterMax"] = "keyword",
+ ["atomicCounterAnd"] = "keyword",
+ ["atomicCounterOr"] = "keyword",
+ ["atomicCounterXor"] = "keyword",
+ ["atomicCounterExchange"] = "keyword",
+ ["atomicCounterCompSwap"] = "keyword",
+ --Atomic Memory Functions
+ ["atomicAdd"] = "keyword",
+ ["atomicMin"] = "keyword",
+ ["atomicMax"] = "keyword",
+ ["atomicAnd"] = "keyword",
+ ["atomicOr"] = "keyword",
+ ["atomicXor"] = "keyword",
+ ["atomicExchange"]= "keyword",
+ ["atomicCompSwap"]= "keyword",
+ --Image Functions
+ ["imageSize"] = "keyword",
+ ["imageSamples"] = "keyword",
+ ["imageLoad"] = "keyword",
+ ["imageStore"] = "keyword",
+ ["imageAtomicAdd"] = "keyword",
+ ["imageAtomicMin"] = "keyword",
+ ["imageAtomicMax"] = "keyword",
+ ["imageAtomicAnd"] = "keyword",
+ ["imageAtomicOr"] = "keyword",
+ ["imageAtomicXor"] = "keyword",
+ ["imageAtomicExchange"]= "keyword",
+ ["imageAtomicCompSwap"]= "keyword",
+ --Geometry Shader Functions
+ ["EmitStreamVertex"] = "keyword",
+ ["EndStreamPrimitive"] = "keyword",
+ ["EmitVertex"] = "keyword",
+ ["EndPrimitive"] = "keyword",
+ --Fragment Processing Functions
+ ["dFdx"] = "keyword",
+ ["dFdy"] = "keyword",
+ ["dFdxFine"] = "keyword",
+ ["dFdyFine"] = "keyword",
+ ["dFdxCoarse"] = "keyword",
+ ["dFdyCoarse"] = "keyword",
+ ["fwidth"] = "keyword",
+ ["fwidthFine"] = "keyword",
+ ["fwidthCoarse"] = "keyword",
+ ["interpolateAtCentroid"]= "keyword",
+ ["interpolateAtSample"] = "keyword",
+ ["interpolateAtOffset"] = "keyword",
+ --Shader Invocation Control Functions
+ ["barrier"] = "keyword",
+ --Shader Memory Control Functions
+ ["memoryBarrier"] = "keyword",
+ ["memoryBarrierAtomicCounter"]= "keyword",
+ ["memoryBarrierBuffer"] = "keyword",
+ ["memoryBarrierShared"] = "keyword",
+ ["memoryBarrierImage"] = "keyword",
+ ["groupMemoryBarrier"] = "keyword",
+ --Subpass-Input Functions
+ ["subpassLoad"] = "keyword",
+ --Shader Invocation Group Functions
+ ["anyInvocation"] = "keyword",
+ ["allInvocations"] = "keyword",
+ ["allInvocationsEqual"]= "keyword",
+
+ --"In addition, when targeting Vulkan, the following keywords also exist:"
+ ["texture1D"] = "keyword",
+ ["texture1DArray"] = "keyword",
+ ["itexture1D"] = "keyword",
+ ["itexture1DArray"] = "keyword",
+ ["utexture1D"] = "keyword",
+ ["utexture1DArray"] = "keyword",
+ ["texture2D"] = "keyword",
+ ["texture2DArray"] = "keyword",
+ ["itexture2D"] = "keyword",
+ ["itexture2DArray"] = "keyword",
+ ["utexture2D"] = "keyword",
+ ["utexture2DArray"] = "keyword",
+ ["texture2DRect"] = "keyword",
+ ["itexture2DRect"] = "keyword",
+ ["utexture2DRect"] = "keyword",
+ ["texture2DMS"] = "keyword",
+ ["itexture2DMS"] = "keyword",
+ ["utexture2DMS"] = "keyword",
+ ["texture2DMSArray"] = "keyword",
+ ["itexture2DMSArray"]= "keyword",
+ ["utexture2DMSArray"]= "keyword",
+ ["texture3D"] = "keyword",
+ ["itexture3D"] = "keyword",
+ ["utexture3D"] = "keyword",
+ ["textureCube"] = "keyword",
+ ["itextureCube"] = "keyword",
+ ["utextureCube"] = "keyword",
+ ["textureCubeArray"] = "keyword",
+ ["itextureCubeArray"]= "keyword",
+ ["utextureCubeArray"]= "keyword",
+ ["textureBuffer"] = "keyword",
+ ["itextureBuffer"] = "keyword",
+ ["utextureBuffer"] = "keyword",
+ ["sampler"] = "keyword2",
+ ["samplerShadow"] = "keyword2",
+ ["subpassInput"] = "keyword2",
+ ["isubpassInput"] = "keyword2",
+ ["usubpassInput"] = "keyword2",
+ ["subpassInputMS"] = "keyword2",
+ ["isubpassInputMS"] = "keyword2",
+ ["usubpassInputMS"] = "keyword2",
+ },
+}
+
diff --git a/plugins/language_hlsl.lua b/plugins/language_hlsl.lua
new file mode 100644
index 0000000..1444ef4
--- /dev/null
+++ b/plugins/language_hlsl.lua
@@ -0,0 +1,275 @@
+
+local style = require "core.style"
+local common = require "core.common"
+
+local syntax = require "core.syntax"
+
+syntax.add {
+ files = { "%.hlsl$", },
+ comment = "//",
+ patterns = {
+ { pattern = "//.-\n", type = "comment" },
+ { pattern = { "/%*", "%*/" }, type = "comment" },
+ { pattern = { "#", "[^\\]\n" }, type = "comment" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "'", "'", '\\' }, type = "string" },
+ { pattern = "-?0x%x+", type = "number" },
+ { pattern = "-?%d+[%d%.eE]*f?", type = "number" },
+ { pattern = "-?%.?%d+f?", type = "number" },
+ { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
+
+ { pattern = "int[1-9]x[1-9]", type = "keyword2" },
+ { pattern = "int1[0-6]x[1-9]", type = "keyword2" },
+ { pattern = "int[1-9]x1[0-6]", type = "keyword2" },
+ { pattern = "int1[0-6]x1[0-6]", type = "keyword2" },
+ { pattern = "int[1-4]", type = "keyword2" },
+
+ { pattern = "uint[1-9]x[1-9]", type = "keyword2" },
+ { pattern = "uint1[0-6]x[1-9]", type = "keyword2" },
+ { pattern = "uint[1-9]x1[0-6]", type = "keyword2" },
+ { pattern = "uint1[0-6]x1[0-6]", type = "keyword2" },
+ { pattern = "uint[1-4]", type = "keyword2" },
+
+ { pattern = "dword[1-9]x[1-9]", type = "keyword2" },
+ { pattern = "dword1[0-6]x[1-9]", type = "keyword2" },
+ { pattern = "dword[1-9]x1[0-6]", type = "keyword2" },
+ { pattern = "dword1[0-6]x1[0-6]", type = "keyword2" },
+ { pattern = "dword[1-4]", type = "keyword2" },
+
+ { pattern = "half[1-9]x[1-9]", type = "keyword2" },
+ { pattern = "half1[0-6]x[1-9]", type = "keyword2" },
+ { pattern = "half[1-9]x1[0-6]", type = "keyword2" },
+ { pattern = "half1[0-6]x1[0-6]", type = "keyword2" },
+ { pattern = "half[1-4]", type = "keyword2" },
+
+ { pattern = "float[1-9]x[1-9]", type = "keyword2" },
+ { pattern = "float1[0-6]x[1-9]", type = "keyword2" },
+ { pattern = "float[1-9]x1[0-6]", type = "keyword2" },
+ { pattern = "float1[0-6]x1[0-6]", type = "keyword2" },
+ { pattern = "float[1-4]", type = "keyword2" },
+
+ { pattern = "double[1-9]x[1-9]", type = "keyword2" },
+ { pattern = "double1[0-6]x[1-9]", type = "keyword2" },
+ { pattern = "double[1-9]x1[0-6]", type = "keyword2" },
+ { pattern = "double1[0-6]x1[0-6]", type = "keyword2" },
+ { pattern = "double[1-4]", type = "keyword2" },
+
+ { pattern = "[%a_][%w_]*%f[(]", type = "function" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ },
+ symbols = {
+ --https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-keywords
+ --The symbols are added in the order they appear on this webpage, which is alphabetically
+ ["AppendStructuredBuffer"]= "keyword",
+ ["asm"] = "keyword",
+ ["asm_fragment"] = "keyword",
+ ["BlendState"] = "keyword2",
+ ["bool"] = "keyword2",
+ ["break"] = "keyword",
+ ["Buffer"] = "keyword2",
+ ["ByteAddressBuffer"]= "keyword2",
+ ["case"] = "keyword",
+ ["cbuffer"] = "keyword2",
+ ["centroid"] = "keyword2",
+ ["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"] = "keyword2",
+ ["DomainShader"] = "keyword2",
+ ["dword"] = "keyword2",
+ ["else"] = "keyword",
+ ["export"] = "keyword",
+ ["extern"] = "keyword",
+ ["false"] = "literal",
+ ["float"] = "keyword2",
+ ["for"] = "keyword",
+ ["fxgroup"] = "keyword2",
+ ["GeometryShader"] = "keyword2",
+ ["groupshared"] = "keyword",
+ ["half"] = "keyword2",
+ ["HullShader"] = "keyword2",
+ ["if"] = "keyword",
+ ["in"] = "keyword",
+ ["inline"] = "keyword",
+ ["inout"] = "keyword",
+ ["InputPatch"] = "keyword2",
+ ["int"] = "keyword2",
+ ["interface"] = "keyword",
+ ["line"] = "keyword2",
+ ["lineadj"] = "keyword2",
+ ["linear"] = "keyword",
+ ["LineStream"] = "keyword2",
+ ["matrix"] = "keyword2",
+ ["min16float"] = "keyword2",
+ ["min10float"] = "keyword2",
+ ["min16int"] = "keyword2",
+ ["min12int"] = "keyword2",
+ ["min16uint"] = "keyword2",
+ ["namespace"] = "keyword",
+ ["nointerpolation"] = "keyword",
+ ["noperspective"] = "keyword",
+ ["NULL"] = "literal",
+ ["out"] = "keyword",
+ ["OutputPatch"] = "keyword2",
+ ["packoffset"] = "keyword",
+ ["pass"] = "keyword",
+ ["pixelfragment"] = "keyword",
+ ["PixelShader"] = "keyword2",
+ ["point"] = "keyword2",
+ ["PointStream"] = "keyword2",
+ ["precise"] = "keyword",
+ ["RasterizerState"] = "keyword2",
+ ["RenderTargetView"] = "keyword2",
+ ["return"] = "keyword",
+ ["register"] = "keyword",
+ ["row_major"] = "keyword",
+ ["RWBuffer"] = "keyword2",
+ ["RWByteAddressBuffer"]= "keyword2",
+ ["RWStructuredBuffer"]= "keyword2",
+ ["RWTexture1D"] = "keyword2",
+ ["RWTexture1DArray"] = "keyword2",
+ ["RWTexture2D"] = "keyword2",
+ ["RWTexture2DArray"] = "keyword2",
+ ["RWTexture3D"] = "keyword2",
+ ["sample"] = "keyword",
+ ["sampler"] = "keyword2",
+ ["SamplerState"] = "keyword2",
+ ["SamplerComparisonState"]= "keyword2",
+ ["shared"] = "keyword",
+ ["snorm"] = "keyword",
+ ["stateblock"] = "keyword",
+ ["stateblock_state"] = "keyword",
+ ["static"] = "keyword",
+ ["string"] = "keyword2",
+ ["struct"] = "keyword",
+ ["switch"] = "keyword",
+ ["StructuredBuffer"] = "keyword2",
+ ["tbuffer"] = "keyword2",
+ ["technique"] = "keyword2",
+ ["technique10"] = "keyword2",
+ ["technique11"] = "keyword2",
+ ["texture"] = "keyword2",
+ ["Texture1D"] = "keyword2",
+ ["Texture1DArray"] = "keyword2",
+ ["Texture2D"] = "keyword2",
+ ["Texture2DArray"] = "keyword2",
+ ["Texture2DMS"] = "keyword2",
+ ["Texture2DMSArray"] = "keyword2",
+ ["Texture3D"] = "keyword2",
+ ["TextureCube"] = "keyword2",
+ ["TextureCubeArray"] = "keyword2",
+ ["true"] = "literal",
+ ["typedef"] = "keyword",
+ ["triangle"] = "keyword2",
+ ["triangleadj"] = "keyword2",
+ ["TriangleStream"] = "keyword2",
+ ["uint"] = "keyword2",
+ ["uniform"] = "keyword",
+ ["unorm"] = "keyword",
+ ["unsigned"] = "keyword",
+ ["vector"] = "keyword2",
+ ["vertexfragment"] = "keyword2",
+ ["VertexShader"] = "keyword2",
+ ["void"] = "keyword",
+ ["volatile"] = "keyword",
+ ["while"] = "keyword",
+
+ --https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-intrinsic-functions
+ --The symbols are added in the order they appear on this webpage, which is alphabetically
+ ["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",
+ },
+}
+