go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/projects/nodes/static/_public/vs/basic-languages/wgsl/wgsl.js (about) 1 /** 2 * Copyright (c) 2024 - Present. Will Charczuk. All rights reserved. 3 * Use of this source code is governed by a MIT license that can be found in the LICENSE file at the root of the repository. 4 */ 5 "use strict";/*!----------------------------------------------------------------------------- 6 * Copyright (c) Microsoft Corporation. All rights reserved. 7 * Version: 0.43.0(94c055bcbdd49f04a0fa15515e848542a79fb948) 8 * Released under the MIT license 9 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt 10 *-----------------------------------------------------------------------------*/ 11 define("vs/basic-languages/wgsl/wgsl", ["require","require"],(require)=>{ 12 var moduleExports=(()=>{var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var a in e)s(t,a,{get:e[a],enumerable:!0})},d=(t,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!u.call(t,i)&&i!==a&&s(t,i,{get:()=>e[i],enumerable:!(o=m(e,i))||o.enumerable});return t};var x=t=>d(s({},"__esModule",{value:!0}),t);var F={};p(F,{conf:()=>f,language:()=>L});var f={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"}]};function r(t){let e=[],a=t.split(/\t+|\r+|\n+| +/);for(let o=0;o<a.length;++o)a[o].length>0&&e.push(a[o]);return e}var g=r("true false"),_=r(` 13 alias 14 break 15 case 16 const 17 const_assert 18 continue 19 continuing 20 default 21 diagnostic 22 discard 23 else 24 enable 25 fn 26 for 27 if 28 let 29 loop 30 override 31 requires 32 return 33 struct 34 switch 35 var 36 while 37 `),h=r(` 38 NULL 39 Self 40 abstract 41 active 42 alignas 43 alignof 44 as 45 asm 46 asm_fragment 47 async 48 attribute 49 auto 50 await 51 become 52 binding_array 53 cast 54 catch 55 class 56 co_await 57 co_return 58 co_yield 59 coherent 60 column_major 61 common 62 compile 63 compile_fragment 64 concept 65 const_cast 66 consteval 67 constexpr 68 constinit 69 crate 70 debugger 71 decltype 72 delete 73 demote 74 demote_to_helper 75 do 76 dynamic_cast 77 enum 78 explicit 79 export 80 extends 81 extern 82 external 83 fallthrough 84 filter 85 final 86 finally 87 friend 88 from 89 fxgroup 90 get 91 goto 92 groupshared 93 highp 94 impl 95 implements 96 import 97 inline 98 instanceof 99 interface 100 layout 101 lowp 102 macro 103 macro_rules 104 match 105 mediump 106 meta 107 mod 108 module 109 move 110 mut 111 mutable 112 namespace 113 new 114 nil 115 noexcept 116 noinline 117 nointerpolation 118 noperspective 119 null 120 nullptr 121 of 122 operator 123 package 124 packoffset 125 partition 126 pass 127 patch 128 pixelfragment 129 precise 130 precision 131 premerge 132 priv 133 protected 134 pub 135 public 136 readonly 137 ref 138 regardless 139 register 140 reinterpret_cast 141 require 142 resource 143 restrict 144 self 145 set 146 shared 147 sizeof 148 smooth 149 snorm 150 static 151 static_assert 152 static_cast 153 std 154 subroutine 155 super 156 target 157 template 158 this 159 thread_local 160 throw 161 trait 162 try 163 type 164 typedef 165 typeid 166 typename 167 typeof 168 union 169 unless 170 unorm 171 unsafe 172 unsized 173 use 174 using 175 varying 176 virtual 177 volatile 178 wgsl 179 where 180 with 181 writeonly 182 yield 183 `),b=r(` 184 read write read_write 185 function private workgroup uniform storage 186 perspective linear flat 187 center centroid sample 188 vertex_index instance_index position front_facing frag_depth 189 local_invocation_id local_invocation_index 190 global_invocation_id workgroup_id num_workgroups 191 sample_index sample_mask 192 rgba8unorm 193 rgba8snorm 194 rgba8uint 195 rgba8sint 196 rgba16uint 197 rgba16sint 198 rgba16float 199 r32uint 200 r32sint 201 r32float 202 rg32uint 203 rg32sint 204 rg32float 205 rgba32uint 206 rgba32sint 207 rgba32float 208 bgra8unorm 209 `),v=r(` 210 bool 211 f16 212 f32 213 i32 214 sampler sampler_comparison 215 texture_depth_2d 216 texture_depth_2d_array 217 texture_depth_cube 218 texture_depth_cube_array 219 texture_depth_multisampled_2d 220 texture_external 221 texture_external 222 u32 223 `),y=r(` 224 array 225 atomic 226 mat2x2 227 mat2x3 228 mat2x4 229 mat3x2 230 mat3x3 231 mat3x4 232 mat4x2 233 mat4x3 234 mat4x4 235 ptr 236 texture_1d 237 texture_2d 238 texture_2d_array 239 texture_3d 240 texture_cube 241 texture_cube_array 242 texture_multisampled_2d 243 texture_storage_1d 244 texture_storage_2d 245 texture_storage_2d_array 246 texture_storage_3d 247 vec2 248 vec3 249 vec4 250 `),k=r(` 251 vec2i vec3i vec4i 252 vec2u vec3u vec4u 253 vec2f vec3f vec4f 254 vec2h vec3h vec4h 255 mat2x2f mat2x3f mat2x4f 256 mat3x2f mat3x3f mat3x4f 257 mat4x2f mat4x3f mat4x4f 258 mat2x2h mat2x3h mat2x4h 259 mat3x2h mat3x3h mat3x4h 260 mat4x2h mat4x3h mat4x4h 261 `),w=r(` 262 bitcast all any select arrayLength abs acos acosh asin asinh atan atanh atan2 263 ceil clamp cos cosh countLeadingZeros countOneBits countTrailingZeros cross 264 degrees determinant distance dot exp exp2 extractBits faceForward firstLeadingBit 265 firstTrailingBit floor fma fract frexp inverseBits inverseSqrt ldexp length 266 log log2 max min mix modf normalize pow quantizeToF16 radians reflect refract 267 reverseBits round saturate sign sin sinh smoothstep sqrt step tan tanh transpose 268 trunc dpdx dpdxCoarse dpdxFine dpdy dpdyCoarse dpdyFine fwidth fwidthCoarse fwidthFine 269 textureDimensions textureGather textureGatherCompare textureLoad textureNumLayers 270 textureNumLevels textureNumSamples textureSample textureSampleBias textureSampleCompare 271 textureSampleCompareLevel textureSampleGrad textureSampleLevel textureSampleBaseClampToEdge 272 textureStore atomicLoad atomicStore atomicAdd atomicSub atomicMax atomicMin 273 atomicAnd atomicOr atomicXor atomicExchange atomicCompareExchangeWeak pack4x8snorm 274 pack4x8unorm pack2x16snorm pack2x16unorm pack2x16float unpack4x8snorm unpack4x8unorm 275 unpack2x16snorm unpack2x16unorm unpack2x16float storageBarrier workgroupBarrier 276 workgroupUniformLoad 277 `),S=r(` 278 & 279 && 280 -> 281 / 282 = 283 == 284 != 285 > 286 >= 287 < 288 <= 289 % 290 - 291 -- 292 + 293 ++ 294 | 295 || 296 * 297 << 298 >> 299 += 300 -= 301 *= 302 /= 303 %= 304 &= 305 |= 306 ^= 307 >>= 308 <<= 309 `),C=/enable|requires|diagnostic/,c=/[_\p{XID_Start}]\p{XID_Continue}*/u,n="variable.predefined",L={tokenPostfix:".wgsl",defaultToken:"invalid",unicode:!0,atoms:g,keywords:_,reserved:h,predeclared_enums:b,predeclared_types:v,predeclared_type_generators:y,predeclared_type_aliases:k,predeclared_intrinsics:w,operators:S,symbols:/[!%&*+\-\.\/:;<=>^|_~,]+/,tokenizer:{root:[[C,"keyword","@directive"],[c,{cases:{"@atoms":n,"@keywords":"keyword","@reserved":"invalid","@predeclared_enums":n,"@predeclared_types":n,"@predeclared_type_generators":n,"@predeclared_type_aliases":n,"@predeclared_intrinsics":n,"@default":"identifier"}}],{include:"@commentOrSpace"},{include:"@numbers"},[/[{}()\[\]]/,"@brackets"],["@","annotation","@attribute"],[/@symbols/,{cases:{"@operators":"operator","@default":"delimiter"}}],[/./,"invalid"]],commentOrSpace:[[/\s+/,"white"],[/\/\*/,"comment","@blockComment"],[/\/\/.*$/,"comment"]],blockComment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],attribute:[{include:"@commentOrSpace"},[/\w+/,"annotation","@pop"]],directive:[{include:"@commentOrSpace"},[/[()]/,"@brackets"],[/,/,"delimiter"],[c,"meta.content"],[/;/,"delimiter","@pop"]],numbers:[[/0[fh]/,"number.float"],[/[1-9][0-9]*[fh]/,"number.float"],[/[0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[fh]?/,"number.float"],[/[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?[fh]?/,"number.float"],[/[0-9]+[eE][+-]?[0-9]+[fh]?/,"number.float"],[/0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+(?:[pP][+-]?[0-9]+[fh]?)?/,"number.hex"],[/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*(?:[pP][+-]?[0-9]+[fh]?)?/,"number.hex"],[/0[xX][0-9a-fA-F]+[pP][+-]?[0-9]+[fh]?/,"number.hex"],[/0[xX][0-9a-fA-F]+[iu]?/,"number.hex"],[/[1-9][0-9]*[iu]?/,"number"],[/0[iu]?/,"number"]]}};return x(F);})(); 310 return moduleExports; 311 });