diff --git a/lexers/embedded/wgsl.xml b/lexers/embedded/wgsl.xml index 5f4422e5a..f583dfffa 100644 --- a/lexers/embedded/wgsl.xml +++ b/lexers/embedded/wgsl.xml @@ -29,7 +29,7 @@ - + diff --git a/lexers/testdata/wgsl.address.space.actual b/lexers/testdata/wgsl.address.space.actual new file mode 100644 index 000000000..5694112d8 --- /dev/null +++ b/lexers/testdata/wgsl.address.space.actual @@ -0,0 +1,5 @@ +alias a=ptr; +alias b=ptr; +alias c=ptr; +alias d=ptr; +alias e=ptr; diff --git a/lexers/testdata/wgsl.address.space.expected b/lexers/testdata/wgsl.address.space.expected new file mode 100644 index 000000000..fd1efafe1 --- /dev/null +++ b/lexers/testdata/wgsl.address.space.expected @@ -0,0 +1,62 @@ +[ + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"a"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"ptr"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"function"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"b"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"ptr"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"private"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"c"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"ptr"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"workgroup"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"d"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"ptr"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"uniform"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"e"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"ptr"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"storage"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.bool.types.actual b/lexers/testdata/wgsl.bool.types.actual new file mode 100644 index 000000000..5f4503033 --- /dev/null +++ b/lexers/testdata/wgsl.bool.types.actual @@ -0,0 +1,4 @@ +alias boolean=bool; +alias bvec2=vec2; +alias bvec3=vec3; +alias bvec4=vec4; diff --git a/lexers/testdata/wgsl.bool.types.expected b/lexers/testdata/wgsl.bool.types.expected new file mode 100644 index 000000000..935d78412 --- /dev/null +++ b/lexers/testdata/wgsl.bool.types.expected @@ -0,0 +1,39 @@ +[ + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"boolean"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"bool"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"bvec2"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"bool"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"bvec3"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"bool"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"bvec4"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"bool"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.depth.texture.actual b/lexers/testdata/wgsl.depth.texture.actual new file mode 100644 index 000000000..aa83d3308 --- /dev/null +++ b/lexers/testdata/wgsl.depth.texture.actual @@ -0,0 +1,5 @@ +@group(0) @binding(1) var texture_depth_2d; +@group(0) @binding(2) var texture_depth_2d_array; +@group(0) @binding(4) var texture_depth_cube; +@group(0) @binding(5) var texture_depth_cube_array; +@group(0) @binding(5) var texture_depth_multisampled_2d; diff --git a/lexers/testdata/wgsl.depth.texture.expected b/lexers/testdata/wgsl.depth.texture.expected new file mode 100644 index 000000000..bcde9cc04 --- /dev/null +++ b/lexers/testdata/wgsl.depth.texture.expected @@ -0,0 +1,77 @@ +[ + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_depth_2d"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"2"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_depth_2d_array"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"4"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_depth_cube"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"5"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_depth_cube_array"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"5"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_depth_multisampled_2d"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.external.texture.actual b/lexers/testdata/wgsl.external.texture.actual new file mode 100644 index 000000000..c9f122f10 --- /dev/null +++ b/lexers/testdata/wgsl.external.texture.actual @@ -0,0 +1 @@ +@group(0) @binding(5) var texture_external; diff --git a/lexers/testdata/wgsl.external.texture.expected b/lexers/testdata/wgsl.external.texture.expected new file mode 100644 index 000000000..1fe6c6b3f --- /dev/null +++ b/lexers/testdata/wgsl.external.texture.expected @@ -0,0 +1,17 @@ +[ + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"5"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_external"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.line.comment.actual b/lexers/testdata/wgsl.line.comment.actual index 31f9cc626..484c7e1db 100644 --- a/lexers/testdata/wgsl.line.comment.actual +++ b/lexers/testdata/wgsl.line.comment.actual @@ -1,3 +1,3 @@ // this is a line-ending comment - //* embed a bock comment start, after gap of space + //* embed a bock comment start, after a space // /* embed a bock comment start, v2 diff --git a/lexers/testdata/wgsl.line.comment.expected b/lexers/testdata/wgsl.line.comment.expected index e4a9759f5..4415a8d86 100644 --- a/lexers/testdata/wgsl.line.comment.expected +++ b/lexers/testdata/wgsl.line.comment.expected @@ -2,5 +2,5 @@ {"type":"TextWhitespace","value":" "}, {"type":"CommentSingle","value":"// this is a line-ending comment\n"}, {"type":"TextWhitespace","value":" "}, - {"type":"CommentSingle","value":"//* embed a bock comment start, after gap of space\n// /* embed a bock comment start, v2\n"} + {"type":"CommentSingle","value":"//* embed a bock comment start, after a space\n// /* embed a bock comment start, v2\n"} ] diff --git a/lexers/testdata/wgsl.multisampled.texture.actual b/lexers/testdata/wgsl.multisampled.texture.actual new file mode 100644 index 000000000..fa9ad7e4e --- /dev/null +++ b/lexers/testdata/wgsl.multisampled.texture.actual @@ -0,0 +1 @@ +@group(0) @binding(5) var texture_multisampled_2d; diff --git a/lexers/testdata/wgsl.multisampled.texture.expected b/lexers/testdata/wgsl.multisampled.texture.expected new file mode 100644 index 000000000..f98be701a --- /dev/null +++ b/lexers/testdata/wgsl.multisampled.texture.expected @@ -0,0 +1,20 @@ +[ + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"5"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_multisampled_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.numeric.types.actual b/lexers/testdata/wgsl.numeric.types.actual new file mode 100644 index 000000000..133388c56 --- /dev/null +++ b/lexers/testdata/wgsl.numeric.types.actual @@ -0,0 +1,62 @@ +enable f16; +alias int=i32; +alias uint=u32; +alias float=f32; +alias half=f16; +alias ivec2=vec2i; +alias uvec2=vec2u; +alias vec2=vec2f; +alias ivec3=vec3i; +alias uvec3=vec3u; +alias vec3=vec3f; +alias ivec4=vec4i; +alias uvec4=vec4u; +alias ivec2_=vec2; +alias uvec2_=vec2; +alias vec2_=vec2; +alias ivec3_=vec3; +alias uvec3_=vec3; +alias vec3_=vec3; +alias ivec4_=vec4; +alias uvec4_=vec4; +alias vec4_=vec4; +alias hvec2=vec2h; +alias hvec3=vec3h; +alias hvec4=vec4h; +alias hvec4_=vec4; +alias m22=mat2x2f; +alias m23=mat2x3f; +alias m24=mat2x4f; +alias m32=mat3x2f; +alias m33=mat3x3f; +alias m34=mat3x4f; +alias m42=mat4x2f; +alias m43=mat4x3f; +alias m44=mat4x4f; +alias m22_=mat2x2; +alias m23_=mat2x3; +alias m24_=mat2x4; +alias m32_=mat3x2; +alias m33_=mat3x3; +alias m34_=mat3x4; +alias m42_=mat4x2; +alias m43_=mat4x3; +alias m44_=mat4x4; +alias m22=mat2x2h; +alias m23=mat2x3h; +alias h24=mat2x4h; +alias h32=mat3x2h; +alias h33=mat3x3h; +alias h34=mat3x4h; +alias h42=mat4x2h; +alias h43=mat4x3h; +alias h44=mat4x4h; +alias h22_=mat2x2; +alias h23_=mat2x3; +alias h24_=mat2x4; +alias h32_=mat3x2; +alias h33_=mat3x3; +alias h34_=mat3x4; +alias h42_=mat4x2; +alias h43_=mat4x3; +alias h44_=mat4x4; diff --git a/lexers/testdata/wgsl.numeric.types.expected b/lexers/testdata/wgsl.numeric.types.expected new file mode 100644 index 000000000..fb71d5dbe --- /dev/null +++ b/lexers/testdata/wgsl.numeric.types.expected @@ -0,0 +1,518 @@ +[ + {"type":"Keyword","value":"enable"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"int"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"uint"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"u32"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"float"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"half"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"ivec2"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec2i"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"uvec2"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec2u"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"vec2"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec2f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"ivec3"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec3i"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"uvec3"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec3u"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"vec3"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec3f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"ivec4"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec4i"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"uvec4"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec4u"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"ivec2_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"uvec2_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"u32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"vec2_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"ivec3_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"uvec3_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"u32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"vec3_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"ivec4_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"uvec4_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"u32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"vec4_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"hvec2"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec2h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"hvec3"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec3h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"hvec4"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec4h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"hvec4_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"vec4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m22"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x2f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m23"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x3f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m24"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x4f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m32"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x2f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m33"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x3f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m34"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x4f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m42"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x2f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m43"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x3f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m44"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x4f"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m22_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m23_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m24_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m32_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m33_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m34_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m42_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m43_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m44_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m22"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x2h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"m23"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x3h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h24"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x4h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h32"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x2h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h33"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x3h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h34"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x4h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h42"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x2h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h43"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x3h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h44"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x4h"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h22_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h23_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h24_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat2x4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h32_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h33_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h34_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat3x4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h42_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x2"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h43_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x3"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"h44_"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"mat4x4"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f16"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.sampled.texture.actual b/lexers/testdata/wgsl.sampled.texture.actual new file mode 100644 index 000000000..89916bfb1 --- /dev/null +++ b/lexers/testdata/wgsl.sampled.texture.actual @@ -0,0 +1,6 @@ +@group(0) @binding(0) var texture_1d; +@group(0) @binding(1) var texture_2d; +@group(0) @binding(2) var texture_2d_array; +@group(0) @binding(3) var texture_3d; +@group(0) @binding(4) var texture_cube; +@group(0) @binding(5) var texture_cube_array; diff --git a/lexers/testdata/wgsl.sampled.texture.expected b/lexers/testdata/wgsl.sampled.texture.expected new file mode 100644 index 000000000..7f6e57f10 --- /dev/null +++ b/lexers/testdata/wgsl.sampled.texture.expected @@ -0,0 +1,110 @@ +[ + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_1d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"2"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_2d_array"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"3"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_3d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"4"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_cube"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"5"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_cube_array"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.storage.texture.actual b/lexers/testdata/wgsl.storage.texture.actual new file mode 100644 index 000000000..1ac4e3f30 --- /dev/null +++ b/lexers/testdata/wgsl.storage.texture.actual @@ -0,0 +1,4 @@ +@group(0) @binding(0) var texture_storage_1d; +@group(0) @binding(1) var texture_storage_2d; +@group(0) @binding(2) var texture_storage_2d_array; +@group(0) @binding(3) var texture_storage_3d; diff --git a/lexers/testdata/wgsl.storage.texture.expected b/lexers/testdata/wgsl.storage.texture.expected new file mode 100644 index 000000000..2ccd619a1 --- /dev/null +++ b/lexers/testdata/wgsl.storage.texture.expected @@ -0,0 +1,82 @@ +[ + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_1d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba8unorm"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba8unorm"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"2"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d_array"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba8unorm"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"3"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_3d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba8unorm"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.texel.formats.actual b/lexers/testdata/wgsl.texel.formats.actual new file mode 100644 index 000000000..7b29bf617 --- /dev/null +++ b/lexers/testdata/wgsl.texel.formats.actual @@ -0,0 +1,17 @@ +@group(0) @binding(0) var texture_storage_2d; +@group(0) @binding(1) var texture_storage_2d; +@group(0) @binding(2) var texture_storage_2d; +@group(0) @binding(3) var texture_storage_2d; +@group(0) @binding(4) var texture_storage_2d; +@group(0) @binding(5) var texture_storage_2d; +@group(0) @binding(6) var texture_storage_2d; +@group(0) @binding(7) var texture_storage_2d; +@group(0) @binding(8) var texture_storage_2d; +@group(0) @binding(9) var texture_storage_2d; +@group(1) @binding(0) var texture_storage_2d; +@group(1) @binding(1) var texture_storage_2d; +@group(1) @binding(2) var texture_storage_2d; +@group(1) @binding(3) var texture_storage_2d; +@group(1) @binding(4) var texture_storage_2d; +@group(1) @binding(5) var texture_storage_2d; +@group(1) @binding(6) var texture_storage_2d; diff --git a/lexers/testdata/wgsl.texel.formats.expected b/lexers/testdata/wgsl.texel.formats.expected new file mode 100644 index 000000000..e44f32aae --- /dev/null +++ b/lexers/testdata/wgsl.texel.formats.expected @@ -0,0 +1,342 @@ +[ + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba8unorm"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba8snorm"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"2"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba8uint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"3"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba8sint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"4"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba16uint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"5"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba16sint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"6"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba16float"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"7"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"r32uint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"8"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"r32sint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"9"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"r32float"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"0"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rg32uint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rg32sint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"2"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rg32float"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"3"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba32uint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"4"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba32sint"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"5"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"rgba32float"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"NameDecorator","value":"@group"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"1"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameDecorator","value":"@binding"}, + {"type":"Punctuation","value":"("}, + {"type":"LiteralNumberInteger","value":"6"}, + {"type":"Punctuation","value":")"}, + {"type":"TextWhitespace","value":" "}, + {"type":"KeywordDeclaration","value":"var"}, + {"type":"TextWhitespace","value":" "}, + {"type":"NameBuiltin","value":"texture_storage_2d"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"bgra8unorm"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"write"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +] diff --git a/lexers/testdata/wgsl.type.generators.actual b/lexers/testdata/wgsl.type.generators.actual new file mode 100644 index 000000000..3c8bbe770 --- /dev/null +++ b/lexers/testdata/wgsl.type.generators.actual @@ -0,0 +1,4 @@ +// Test predeclared type generators, other than vector, matrix, and texture. +alias a=array; +alias b=atomic; +alias c=ptr; diff --git a/lexers/testdata/wgsl.type.generators.expected b/lexers/testdata/wgsl.type.generators.expected new file mode 100644 index 000000000..184e9bb0c --- /dev/null +++ b/lexers/testdata/wgsl.type.generators.expected @@ -0,0 +1,35 @@ +[ + {"type":"CommentSingle","value":"// Test predeclared type generators, other than vector, matrix, and texture.\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"a"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"array"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"f32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"b"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"atomic"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"}, + {"type":"Keyword","value":"alias"}, + {"type":"TextWhitespace","value":" "}, + {"type":"Name","value":"c"}, + {"type":"Operator","value":"="}, + {"type":"NameBuiltin","value":"ptr"}, + {"type":"Operator","value":"\u003c"}, + {"type":"NameBuiltin","value":"function"}, + {"type":"Punctuation","value":","}, + {"type":"NameBuiltin","value":"i32"}, + {"type":"Operator","value":"\u003e"}, + {"type":"Punctuation","value":";"}, + {"type":"TextWhitespace","value":"\n"} +]