228 lines
8.4 KiB
XML
228 lines
8.4 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE language [
|
|
]>
|
|
<language name="WGSL"
|
|
version="1"
|
|
kateversion="6.0"
|
|
section="3D"
|
|
extensions="*.wgsl"
|
|
mimetype="text/wgsl"
|
|
license="LGPLv2+">
|
|
|
|
<highlighting>
|
|
<list name="keyword">
|
|
<item>alias</item>
|
|
<item>const</item>
|
|
<item>const_assert</item>
|
|
<item>diagnostic</item>
|
|
<item>enable</item>
|
|
<item>false</item>
|
|
<item>fn</item>
|
|
<item>let</item>
|
|
<item>override</item>
|
|
<item>requires</item>
|
|
<item>struct</item>
|
|
<item>true</item>
|
|
<item>var</item>
|
|
</list>
|
|
|
|
<list name="control">
|
|
<item>break</item>
|
|
<item>case</item>
|
|
<item>continue</item>
|
|
<item>continuing</item>
|
|
<item>default</item>
|
|
<item>discard</item>
|
|
<item>else</item>
|
|
<item>for</item>
|
|
<item>if</item>
|
|
<item>loop</item>
|
|
<item>return</item>
|
|
<item>switch</item>
|
|
<item>while</item>
|
|
</list>
|
|
|
|
<list name="type">
|
|
<item>bool</item>
|
|
<item>f16</item>
|
|
<item>f32</item>
|
|
<item>i32</item>
|
|
<item>u32</item>
|
|
<item>vec2</item>
|
|
<item>vec3</item>
|
|
<item>vec4</item>
|
|
<item>mat2x2</item>
|
|
<item>mat2x3</item>
|
|
<item>mat2x4</item>
|
|
<item>mat3x2</item>
|
|
<item>mat3x3</item>
|
|
<item>mat3x4</item>
|
|
<item>mat4x2</item>
|
|
<item>mat4x3</item>
|
|
<item>mat4x4</item>
|
|
<item>array</item>
|
|
</list>
|
|
|
|
<list name="simple_attribute">
|
|
<item>@compute</item>
|
|
<item>@const</item>
|
|
<item>@fragment</item>
|
|
<item>@invariant</item>
|
|
<item>@must_use</item>
|
|
<item>@vertex</item>
|
|
</list>
|
|
|
|
<list name="expr_attribute">
|
|
<item>@align</item>
|
|
<item>@binding</item>
|
|
<item>@blend_src</item>
|
|
<item>@group</item>
|
|
<item>@id</item>
|
|
<item>@location</item>
|
|
<item>@size</item>
|
|
<item>@workgroup_size</item> <!-- 3 exprs, but OK -->
|
|
</list>
|
|
|
|
<list name="special_attribute">
|
|
<item>@builtin</item>
|
|
<item>@diagnostic</item>
|
|
<item>@interpolate</item>
|
|
</list>
|
|
|
|
<list name="attribute">
|
|
<include>simple_attribute</include>
|
|
<include>expr_attribute</include>
|
|
<include>special_attribute</include>
|
|
</list>
|
|
|
|
<list name="builtin_value_name">
|
|
<item>vertex_index</item>
|
|
<item>instance_index</item>
|
|
<item>position</item>
|
|
<item>front_facing</item>
|
|
<item>frag_depth</item>
|
|
<item>sample_index</item>
|
|
<item>sample_mask</item>
|
|
<item>local_invocation_id</item>
|
|
<item>local_invocation_index</item>
|
|
<item>global_invocation_id</item>
|
|
<item>workgroup_id</item>
|
|
<item>num_workgroups</item>
|
|
</list>
|
|
|
|
<list name="interpolation_type">
|
|
<item>perspective</item>
|
|
<item>linear</item>
|
|
<item>flat</item>
|
|
</list>
|
|
|
|
<list name="interpolation_sampling">
|
|
<item>center</item>
|
|
<item>centroid</item>
|
|
<item>sample</item>
|
|
<item>first</item>
|
|
<item>either</item>
|
|
</list>
|
|
|
|
<contexts>
|
|
<context attribute="Normal Text" lineEndContext="#pop" name="Normal">
|
|
<IncludeRules context="_Keywords" />
|
|
<IncludeRules context="_Attributes" />
|
|
<IncludeRules context="_Numbers" />
|
|
<IncludeRules context="_Comments" />
|
|
</context>
|
|
|
|
<context name="_Keywords">
|
|
<keyword attribute="Keyword" context="#stay" String="keyword" />
|
|
<keyword attribute="Control Flow" context="#stay" String="control" />
|
|
<keyword attribute="BuiltIn" context="#stay" String="type" />
|
|
</context>
|
|
|
|
<context name="_Numbers">
|
|
<RegExpr attribute="Hexadecimal Float" context="#stay" String="\b0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+([pP][+-]?[0-9]+[fh]?)?" />
|
|
<RegExpr attribute="Hexadecimal Float" context="#stay" String="\b0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*([pP][+-]?[0-9]+[fh]?)?" />
|
|
<RegExpr attribute="Hexadecimal Float" context="#stay" String="\b0[xX][0-9a-fA-F]+[pP][+-]?[0-9]+[fh]?" />
|
|
<RegExpr attribute="Hexadecimal Integer" context="#stay" String="\b0[xX][0-9a-fA-F]+[iu]?" />
|
|
<RegExpr attribute="Decimal Float" context="#stay" String="\b0[fh]" />
|
|
<RegExpr attribute="Decimal Float" context="#stay" String="\b[1-9][0-9]*[fh]" />
|
|
<RegExpr attribute="Decimal Float" context="#stay" String="\b[0-9]+\.[0-9]+([eE][+-]?[0-9]+)?[fh]?" />
|
|
<RegExpr attribute="Decimal Float" context="#stay" String="\.[0-9]+([eE][+-]?[0-9]+)?[fh]?" />
|
|
<RegExpr attribute="Decimal Float" context="#stay" String="\b[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?[fh]?" />
|
|
<RegExpr attribute="Decimal Float" context="#stay" String="\b[0-9]+[eE][+-]?[0-9]+[fh]?" />
|
|
<RegExpr attribute="Decimal Integer" context="#stay" String="\b0[iu]?" />
|
|
<RegExpr attribute="Decimal Integer" context="#stay" String="\b[1-9][0-9]*[iu]?" />
|
|
</context>
|
|
|
|
<context name="_Comments">
|
|
<Detect2Chars attribute="Comment" context="LineComment" char="/" char1="/" />
|
|
<Detect2Chars attribute="Comment" context="MultilineComment" char="/" char1="*" beginRegion="CommentFolding" />
|
|
</context>
|
|
<context attribute="Comment" lineEndContext="#pop" name="LineComment">
|
|
<IncludeRules context="##Alerts" />
|
|
</context>
|
|
<context attribute="Comment" lineEndContext="#stay" name="MultilineComment">
|
|
<Detect2Chars attribute="Comment" context="MultilineComment" char="/" char1="*" beginRegion="CommentFolding" />
|
|
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="CommentFolding" />
|
|
<IncludeRules context="##Alerts" />
|
|
</context>
|
|
|
|
<context name="_Attributes">
|
|
<keyword attribute="Known Attribute" context="#stay" String="simple_attribute" />
|
|
<keyword attribute="Known Attribute" context="AttributeExprArgsExpected" String="expr_attribute" />
|
|
<keyword attribute="Known Attribute" context="AttributeArgsExpected" String="special_attribute" />
|
|
<DetectChar attribute="Unknown Attribute" context="UnknownAttribute" char="@" />
|
|
</context>
|
|
|
|
<context attribute="Attribute Content" lineEndContext="#stay" name="AttributeExprArgsExpected">
|
|
<DetectChar attribute="Attribute Content" context="#pop!AttributeExprArgs" char="(" />
|
|
<RegExpr attribute="Error" context="#pop" String="[^\s(]" />
|
|
</context>
|
|
<context attribute="Attribute Content" lineEndContext="#stay" name="AttributeExprArgs">
|
|
<DetectChar attribute="Attribute Content" context="AttributeExprArgs" char="(" />
|
|
<DetectChar attribute="Attribute Content" context="#pop" char=")" />
|
|
<IncludeRules context="Normal" />
|
|
</context>
|
|
|
|
<context attribute="Attribute Content" lineEndContext="#stay" name="AttributeArgsExpected">
|
|
<DetectChar attribute="Attribute Content" context="#pop!AttributeArgs" char="(" />
|
|
<RegExpr attribute="Error" context="#pop" String="[^\s(]" />
|
|
</context>
|
|
<context attribute="Attribute Content" lineEndContext="#stay" name="AttributeArgs">
|
|
<DetectChar attribute="Error" context="#pop" char="(" />
|
|
<DetectChar attribute="Attribute Content" context="#pop" char=")" />
|
|
<keyword attribute="Keyword Attribute Value" context="#stay" String="builtin_value_name" />
|
|
<keyword attribute="Keyword Attribute Value" context="#stay" String="interpolation_type" />
|
|
<keyword attribute="Keyword Attribute Value" context="#stay" String="interpolation_sampling" />
|
|
</context>
|
|
|
|
<context attribute="Unknown Attribute" lineEndContext="#stay" name="UnknownAttribute">
|
|
<DetectIdentifier attribute="Unknown Attribute" context="#pop" />
|
|
</context>
|
|
</contexts>
|
|
|
|
<itemDatas>
|
|
<itemData spellChecking="false" name="Normal Text" defStyleNum="dsNormal" />
|
|
<itemData spellChecking="false" name="Keyword" defStyleNum="dsKeyword" />
|
|
<itemData spellChecking="false" name="Control Flow" defStyleNum="dsControlFlow" />
|
|
<itemData spellChecking="false" name="BuiltIn" defStyleNum="dsDataType" />
|
|
<itemData spellChecking="false" name="Error" defStyleNum="dsError" />
|
|
<itemData spellChecking="false" name="Unknown Attribute" defStyleNum="dsError" />
|
|
<itemData spellChecking="false" name="Known Attribute" defStyleNum="dsAttribute" />
|
|
<itemData spellChecking="false" name="Attribute Content" defStyleNum="dsAttribute" />
|
|
<itemData spellChecking="false" name="Keyword Attribute Value" defStyleNum="dsAttribute" italic="true" />
|
|
<itemData spellChecking="true" name="Comment" defStyleNum="dsComment" />
|
|
<itemData spellChecking="false" name="Decimal Integer" defStyleNum="dsDecVal" />
|
|
<itemData spellChecking="false" name="Hexadecimal Integer" defStyleNum="dsBaseN" />
|
|
<itemData spellChecking="false" name="Decimal Float" defStyleNum="dsFloat" />
|
|
<itemData spellChecking="false" name="Hexadecimal Float" defStyleNum="dsFloat" />
|
|
</itemDatas>
|
|
</highlighting>
|
|
|
|
<general>
|
|
<comments>
|
|
<comment name="singleLine" start="//" />
|
|
<comment name="multiLine" start="/*" end="*/" region="CommentFolding" />
|
|
</comments>
|
|
</general>
|
|
</language>
|