@harmoniclabs/monaco-editor 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (766) hide show
  1. package/.azure-pipelines/publish-nightly.yml +90 -0
  2. package/.azure-pipelines/publish-stable.yml +89 -0
  3. package/.devcontainer/devcontainer.json +8 -0
  4. package/.gitattributes +1 -0
  5. package/.github/ISSUE_TEMPLATE/1_bug_report.yaml +57 -0
  6. package/.github/ISSUE_TEMPLATE/2_feature_request.yaml +38 -0
  7. package/.github/ISSUE_TEMPLATE/3_other.md +4 -0
  8. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  9. package/.github/publish-failure-issue-template.md +7 -0
  10. package/.github/workflows/ci.yml +76 -0
  11. package/.github/workflows/website.yml +66 -0
  12. package/.husky/pre-commit +4 -0
  13. package/.mocharc.json +4 -0
  14. package/.nvmrc +1 -0
  15. package/.prettierignore +17 -0
  16. package/.prettierrc +8 -0
  17. package/.vscode/launch.json +68 -0
  18. package/.vscode/settings.json +16 -0
  19. package/.vscode/tasks.json +30 -0
  20. package/CHANGELOG.md +1655 -0
  21. package/CONTRIBUTING.md +125 -0
  22. package/LICENSE.txt +21 -0
  23. package/MAINTAINING.md +55 -0
  24. package/README.md +122 -0
  25. package/SECURITY.md +41 -0
  26. package/ThirdPartyNotices.txt +392 -0
  27. package/build/build-languages.ts +212 -0
  28. package/build/build-monaco-editor.ts +463 -0
  29. package/build/check-samples.ts +53 -0
  30. package/build/fillers/vscode-nls.ts +46 -0
  31. package/build/fs.ts +80 -0
  32. package/build/importTypescript.ts +192 -0
  33. package/build/npm/installAll.ts +44 -0
  34. package/build/npm/removeAll.ts +20 -0
  35. package/build/postinstall.ts +23 -0
  36. package/build/releaseMetadata.ts +280 -0
  37. package/build/simpleserver.ts +69 -0
  38. package/build/tsconfig.json +8 -0
  39. package/build/utils.ts +291 -0
  40. package/docs/code-structure.dio.svg +275 -0
  41. package/docs/debugging-core.gif +0 -0
  42. package/docs/debugging-languages.gif +0 -0
  43. package/docs/integrate-amd.md +28 -0
  44. package/docs/integrate-esm.md +229 -0
  45. package/docs/launch config.png +0 -0
  46. package/docs/out-folders.dio.svg +347 -0
  47. package/editor.code-workspace +13 -0
  48. package/gulpfile.js +9 -0
  49. package/package.json +80 -0
  50. package/samples/README.md +36 -0
  51. package/samples/browser-amd-diff-editor/index.html +62 -0
  52. package/samples/browser-amd-diff-editor/modified.txt +74 -0
  53. package/samples/browser-amd-diff-editor/original.txt +61 -0
  54. package/samples/browser-amd-editor/index.html +24 -0
  55. package/samples/browser-amd-iframe/index.html +70 -0
  56. package/samples/browser-amd-iframe/inner.html +34 -0
  57. package/samples/browser-amd-localized/index.html +30 -0
  58. package/samples/browser-amd-monarch/index.html +105 -0
  59. package/samples/browser-amd-requirejs/index.html +26 -0
  60. package/samples/browser-amd-shadow-dom/index.html +50 -0
  61. package/samples/browser-amd-shared-model/index.html +29 -0
  62. package/samples/browser-amd-trusted-types/index.html +42 -0
  63. package/samples/browser-esm-esbuild/build.js +96 -0
  64. package/samples/browser-esm-esbuild/index.html +18 -0
  65. package/samples/browser-esm-esbuild/index.js +24 -0
  66. package/samples/browser-esm-esbuild/package.json +6 -0
  67. package/samples/browser-esm-parcel/index.html +19 -0
  68. package/samples/browser-esm-parcel/package-lock.json +3953 -0
  69. package/samples/browser-esm-parcel/package.json +10 -0
  70. package/samples/browser-esm-parcel/src/index.html +11 -0
  71. package/samples/browser-esm-parcel/src/index.js +29 -0
  72. package/samples/browser-esm-vite-react/index.html +12 -0
  73. package/samples/browser-esm-vite-react/package-lock.json +2341 -0
  74. package/samples/browser-esm-vite-react/package.json +20 -0
  75. package/samples/browser-esm-vite-react/src/components/Editor.module.css +4 -0
  76. package/samples/browser-esm-vite-react/src/components/Editor.tsx +25 -0
  77. package/samples/browser-esm-vite-react/src/main.tsx +11 -0
  78. package/samples/browser-esm-vite-react/src/userWorker.ts +27 -0
  79. package/samples/browser-esm-vite-react/src/vite-env.d.ts +1 -0
  80. package/samples/browser-esm-vite-react/tsconfig.json +11 -0
  81. package/samples/browser-esm-vite-react/vite.config.ts +7 -0
  82. package/samples/browser-esm-webpack/index.html +20 -0
  83. package/samples/browser-esm-webpack/index.js +24 -0
  84. package/samples/browser-esm-webpack/package.json +6 -0
  85. package/samples/browser-esm-webpack/webpack.config.js +30 -0
  86. package/samples/browser-esm-webpack-monaco-plugin/index.html +20 -0
  87. package/samples/browser-esm-webpack-monaco-plugin/index.js +16 -0
  88. package/samples/browser-esm-webpack-monaco-plugin/package.json +6 -0
  89. package/samples/browser-esm-webpack-monaco-plugin/webpack.config.js +28 -0
  90. package/samples/browser-esm-webpack-small/generate-imports.js +140 -0
  91. package/samples/browser-esm-webpack-small/index.html +26 -0
  92. package/samples/browser-esm-webpack-small/index.js +168 -0
  93. package/samples/browser-esm-webpack-small/package.json +7 -0
  94. package/samples/browser-esm-webpack-small/webpack.config.js +35 -0
  95. package/samples/browser-esm-webpack-typescript/package.json +7 -0
  96. package/samples/browser-esm-webpack-typescript/src/index.css +5 -0
  97. package/samples/browser-esm-webpack-typescript/src/index.ts +26 -0
  98. package/samples/browser-esm-webpack-typescript/tsconfig.json +16 -0
  99. package/samples/browser-esm-webpack-typescript/webpack.config.js +44 -0
  100. package/samples/browser-esm-webpack-typescript-react/package-lock.json +6183 -0
  101. package/samples/browser-esm-webpack-typescript-react/package.json +21 -0
  102. package/samples/browser-esm-webpack-typescript-react/src/components/Editor.tsx +38 -0
  103. package/samples/browser-esm-webpack-typescript-react/src/index.css +5 -0
  104. package/samples/browser-esm-webpack-typescript-react/src/index.html +10 -0
  105. package/samples/browser-esm-webpack-typescript-react/src/index.tsx +12 -0
  106. package/samples/browser-esm-webpack-typescript-react/tsconfig.json +18 -0
  107. package/samples/browser-esm-webpack-typescript-react/webpack.config.js +59 -0
  108. package/samples/browser-script-editor/index.html +28 -0
  109. package/samples/electron-amd/electron-index.html +37 -0
  110. package/samples/electron-amd/index.html +18 -0
  111. package/samples/electron-amd/main.js +32 -0
  112. package/samples/electron-amd/package.json +7 -0
  113. package/samples/electron-amd-nodeIntegration/electron-index.html +46 -0
  114. package/samples/electron-amd-nodeIntegration/index.html +18 -0
  115. package/samples/electron-amd-nodeIntegration/main.js +37 -0
  116. package/samples/electron-amd-nodeIntegration/package.json +7 -0
  117. package/samples/electron-esm-webpack/index.js +24 -0
  118. package/samples/electron-esm-webpack/main.js +32 -0
  119. package/samples/electron-esm-webpack/package.json +8 -0
  120. package/samples/electron-esm-webpack/webpack.config.js +29 -0
  121. package/samples/nwjs-amd/index.html +48 -0
  122. package/samples/nwjs-amd-v2/index.html +57 -0
  123. package/samples/package-lock.json +7808 -0
  124. package/samples/package.json +32 -0
  125. package/scripts/ci/env.ts +15 -0
  126. package/scripts/ci/monaco-editor-core-prepare.ts +81 -0
  127. package/scripts/ci/monaco-editor-core.sh +34 -0
  128. package/scripts/ci/monaco-editor-prepare.ts +75 -0
  129. package/scripts/ci/monaco-editor.sh +29 -0
  130. package/scripts/lib/index.ts +95 -0
  131. package/src/basic-languages/_.contribution.ts +80 -0
  132. package/src/basic-languages/abap/abap.contribution.ts +24 -0
  133. package/src/basic-languages/abap/abap.test.ts +360 -0
  134. package/src/basic-languages/abap/abap.ts +1390 -0
  135. package/src/basic-languages/apex/apex.contribution.ts +25 -0
  136. package/src/basic-languages/apex/apex.test.ts +700 -0
  137. package/src/basic-languages/apex/apex.ts +355 -0
  138. package/src/basic-languages/azcli/azcli.contribution.ts +24 -0
  139. package/src/basic-languages/azcli/azcli.test.ts +172 -0
  140. package/src/basic-languages/azcli/azcli.ts +77 -0
  141. package/src/basic-languages/bat/bat.contribution.ts +24 -0
  142. package/src/basic-languages/bat/bat.test.ts +397 -0
  143. package/src/basic-languages/bat/bat.ts +121 -0
  144. package/src/basic-languages/bicep/bicep.contribution.ts +24 -0
  145. package/src/basic-languages/bicep/bicep.test.ts +1063 -0
  146. package/src/basic-languages/bicep/bicep.ts +129 -0
  147. package/src/basic-languages/cameligo/cameligo.contribution.ts +24 -0
  148. package/src/basic-languages/cameligo/cameligo.test.ts +144 -0
  149. package/src/basic-languages/cameligo/cameligo.ts +193 -0
  150. package/src/basic-languages/clojure/clojure.contribution.ts +24 -0
  151. package/src/basic-languages/clojure/clojure.test.ts +943 -0
  152. package/src/basic-languages/clojure/clojure.ts +792 -0
  153. package/src/basic-languages/coffee/coffee.contribution.ts +25 -0
  154. package/src/basic-languages/coffee/coffee.test.ts +2363 -0
  155. package/src/basic-languages/coffee/coffee.ts +258 -0
  156. package/src/basic-languages/cpp/cpp.contribution.ts +38 -0
  157. package/src/basic-languages/cpp/cpp.test.ts +979 -0
  158. package/src/basic-languages/cpp/cpp.ts +416 -0
  159. package/src/basic-languages/csharp/csharp.contribution.ts +24 -0
  160. package/src/basic-languages/csharp/csharp.test.ts +976 -0
  161. package/src/basic-languages/csharp/csharp.ts +352 -0
  162. package/src/basic-languages/csp/csp.contribution.ts +24 -0
  163. package/src/basic-languages/csp/csp.test.ts +8 -0
  164. package/src/basic-languages/csp/csp.ts +58 -0
  165. package/src/basic-languages/css/css.contribution.ts +25 -0
  166. package/src/basic-languages/css/css.test.ts +591 -0
  167. package/src/basic-languages/css/css.ts +215 -0
  168. package/src/basic-languages/cypher/cypher.contribution.ts +24 -0
  169. package/src/basic-languages/cypher/cypher.test.ts +327 -0
  170. package/src/basic-languages/cypher/cypher.ts +274 -0
  171. package/src/basic-languages/dart/dart.contribution.ts +25 -0
  172. package/src/basic-languages/dart/dart.test.ts +558 -0
  173. package/src/basic-languages/dart/dart.ts +305 -0
  174. package/src/basic-languages/dockerfile/dockerfile.contribution.ts +25 -0
  175. package/src/basic-languages/dockerfile/dockerfile.test.ts +238 -0
  176. package/src/basic-languages/dockerfile/dockerfile.ts +145 -0
  177. package/src/basic-languages/ecl/ecl.contribution.ts +24 -0
  178. package/src/basic-languages/ecl/ecl.test.ts +8 -0
  179. package/src/basic-languages/ecl/ecl.ts +481 -0
  180. package/src/basic-languages/elixir/elixir.contribution.ts +24 -0
  181. package/src/basic-languages/elixir/elixir.test.ts +447 -0
  182. package/src/basic-languages/elixir/elixir.ts +656 -0
  183. package/src/basic-languages/flow9/flow9.contribution.ts +24 -0
  184. package/src/basic-languages/flow9/flow9.test.ts +148 -0
  185. package/src/basic-languages/flow9/flow9.ts +160 -0
  186. package/src/basic-languages/freemarker2/freemarker2-angle-bracket.test.ts +3099 -0
  187. package/src/basic-languages/freemarker2/freemarker2-angle-dollar.test.ts +3099 -0
  188. package/src/basic-languages/freemarker2/freemarker2-auto-bracket.test.ts +5358 -0
  189. package/src/basic-languages/freemarker2/freemarker2-auto-dollar.test.ts +5361 -0
  190. package/src/basic-languages/freemarker2/freemarker2-bracket-bracket.test.ts +3086 -0
  191. package/src/basic-languages/freemarker2/freemarker2-bracket-dollar.test.ts +3086 -0
  192. package/src/basic-languages/freemarker2/freemarker2.contribution.ts +111 -0
  193. package/src/basic-languages/freemarker2/freemarker2.ts +1230 -0
  194. package/src/basic-languages/fsharp/fsharp.contribution.ts +24 -0
  195. package/src/basic-languages/fsharp/fsharp.test.ts +491 -0
  196. package/src/basic-languages/fsharp/fsharp.ts +237 -0
  197. package/src/basic-languages/go/go.contribution.ts +24 -0
  198. package/src/basic-languages/go/go.test.ts +1492 -0
  199. package/src/basic-languages/go/go.ts +238 -0
  200. package/src/basic-languages/graphql/graphql.contribution.ts +25 -0
  201. package/src/basic-languages/graphql/graphql.test.ts +138 -0
  202. package/src/basic-languages/graphql/graphql.ts +174 -0
  203. package/src/basic-languages/handlebars/handlebars.contribution.ts +25 -0
  204. package/src/basic-languages/handlebars/handlebars.test.ts +354 -0
  205. package/src/basic-languages/handlebars/handlebars.ts +432 -0
  206. package/src/basic-languages/hcl/hcl.contribution.ts +24 -0
  207. package/src/basic-languages/hcl/hcl.test.ts +1228 -0
  208. package/src/basic-languages/hcl/hcl.ts +189 -0
  209. package/src/basic-languages/html/html.contribution.ts +25 -0
  210. package/src/basic-languages/html/html.test.ts +743 -0
  211. package/src/basic-languages/html/html.ts +355 -0
  212. package/src/basic-languages/ini/ini.contribution.ts +25 -0
  213. package/src/basic-languages/ini/ini.ts +82 -0
  214. package/src/basic-languages/java/java.contribution.ts +25 -0
  215. package/src/basic-languages/java/java.test.ts +878 -0
  216. package/src/basic-languages/java/java.ts +252 -0
  217. package/src/basic-languages/javascript/javascript.contribution.ts +27 -0
  218. package/src/basic-languages/javascript/javascript.test.ts +924 -0
  219. package/src/basic-languages/javascript/javascript.ts +77 -0
  220. package/src/basic-languages/julia/julia.contribution.ts +24 -0
  221. package/src/basic-languages/julia/julia.test.ts +38 -0
  222. package/src/basic-languages/julia/julia.ts +550 -0
  223. package/src/basic-languages/kotlin/kotlin.contribution.ts +25 -0
  224. package/src/basic-languages/kotlin/kotlin.test.ts +753 -0
  225. package/src/basic-languages/kotlin/kotlin.ts +273 -0
  226. package/src/basic-languages/less/less.contribution.ts +25 -0
  227. package/src/basic-languages/less/less.test.ts +1560 -0
  228. package/src/basic-languages/less/less.ts +198 -0
  229. package/src/basic-languages/lexon/lexon.contribution.ts +24 -0
  230. package/src/basic-languages/lexon/lexon.test.ts +145 -0
  231. package/src/basic-languages/lexon/lexon.ts +179 -0
  232. package/src/basic-languages/liquid/liquid.contribution.ts +25 -0
  233. package/src/basic-languages/liquid/liquid.test.ts +209 -0
  234. package/src/basic-languages/liquid/liquid.ts +251 -0
  235. package/src/basic-languages/lua/lua.contribution.ts +24 -0
  236. package/src/basic-languages/lua/lua.test.ts +86 -0
  237. package/src/basic-languages/lua/lua.ts +178 -0
  238. package/src/basic-languages/m3/m3.contribution.ts +24 -0
  239. package/src/basic-languages/m3/m3.test.ts +119 -0
  240. package/src/basic-languages/m3/m3.ts +226 -0
  241. package/src/basic-languages/markdown/markdown.contribution.ts +24 -0
  242. package/src/basic-languages/markdown/markdown.test.ts +95 -0
  243. package/src/basic-languages/markdown/markdown.ts +256 -0
  244. package/src/basic-languages/mdx/mdx.contribution.ts +24 -0
  245. package/src/basic-languages/mdx/mdx.test.ts +171 -0
  246. package/src/basic-languages/mdx/mdx.ts +163 -0
  247. package/src/basic-languages/mips/mips.contribution.ts +25 -0
  248. package/src/basic-languages/mips/mips.test.ts +239 -0
  249. package/src/basic-languages/mips/mips.ts +223 -0
  250. package/src/basic-languages/monaco.contribution.ts +87 -0
  251. package/src/basic-languages/msdax/msdax.contribution.ts +24 -0
  252. package/src/basic-languages/msdax/msdax.test.ts +444 -0
  253. package/src/basic-languages/msdax/msdax.ts +382 -0
  254. package/src/basic-languages/mysql/keywords.js +32 -0
  255. package/src/basic-languages/mysql/keywords.mysql.txt +750 -0
  256. package/src/basic-languages/mysql/mysql.contribution.ts +24 -0
  257. package/src/basic-languages/mysql/mysql.test.ts +561 -0
  258. package/src/basic-languages/mysql/mysql.ts +885 -0
  259. package/src/basic-languages/objective-c/objective-c.contribution.ts +24 -0
  260. package/src/basic-languages/objective-c/objective-c.test.ts +368 -0
  261. package/src/basic-languages/objective-c/objective-c.ts +219 -0
  262. package/src/basic-languages/pascal/pascal.contribution.ts +25 -0
  263. package/src/basic-languages/pascal/pascal.test.ts +151 -0
  264. package/src/basic-languages/pascal/pascal.ts +270 -0
  265. package/src/basic-languages/pascaligo/pascaligo.contribution.ts +24 -0
  266. package/src/basic-languages/pascaligo/pascaligo.test.ts +143 -0
  267. package/src/basic-languages/pascaligo/pascaligo.ts +183 -0
  268. package/src/basic-languages/pebble/pebble.contribution.ts +24 -0
  269. package/src/basic-languages/pebble/pebble.test.ts +178 -0
  270. package/src/basic-languages/pebble/pebble.ts +457 -0
  271. package/src/basic-languages/perl/perl.contribution.ts +24 -0
  272. package/src/basic-languages/perl/perl.test.ts +475 -0
  273. package/src/basic-languages/perl/perl.ts +664 -0
  274. package/src/basic-languages/pgsql/keywords.js +30 -0
  275. package/src/basic-languages/pgsql/keywords.postgresql.txt +827 -0
  276. package/src/basic-languages/pgsql/pgsql.contribution.ts +24 -0
  277. package/src/basic-languages/pgsql/pgsql.test.ts +595 -0
  278. package/src/basic-languages/pgsql/pgsql.ts +858 -0
  279. package/src/basic-languages/php/php.contribution.ts +25 -0
  280. package/src/basic-languages/php/php.test.ts +2409 -0
  281. package/src/basic-languages/php/php.ts +636 -0
  282. package/src/basic-languages/pla/pla.contribution.ts +23 -0
  283. package/src/basic-languages/pla/pla.test.ts +598 -0
  284. package/src/basic-languages/pla/pla.ts +157 -0
  285. package/src/basic-languages/postiats/postiats.contribution.ts +24 -0
  286. package/src/basic-languages/postiats/postiats.test.ts +1050 -0
  287. package/src/basic-languages/postiats/postiats.ts +748 -0
  288. package/src/basic-languages/powerquery/powerquery.contribution.ts +24 -0
  289. package/src/basic-languages/powerquery/powerquery.test.ts +416 -0
  290. package/src/basic-languages/powerquery/powerquery.ts +917 -0
  291. package/src/basic-languages/powershell/powershell.contribution.ts +24 -0
  292. package/src/basic-languages/powershell/powershell.test.ts +884 -0
  293. package/src/basic-languages/powershell/powershell.ts +263 -0
  294. package/src/basic-languages/protobuf/protobuf.contribution.ts +24 -0
  295. package/src/basic-languages/protobuf/protobuf.test.ts +2073 -0
  296. package/src/basic-languages/protobuf/protobuf.ts +463 -0
  297. package/src/basic-languages/pug/pug.contribution.ts +24 -0
  298. package/src/basic-languages/pug/pug.test.ts +473 -0
  299. package/src/basic-languages/pug/pug.ts +434 -0
  300. package/src/basic-languages/python/python.contribution.ts +25 -0
  301. package/src/basic-languages/python/python.test.ts +257 -0
  302. package/src/basic-languages/python/python.ts +296 -0
  303. package/src/basic-languages/qsharp/qsharp.contribution.ts +24 -0
  304. package/src/basic-languages/qsharp/qsharp.test.ts +186 -0
  305. package/src/basic-languages/qsharp/qsharp.ts +325 -0
  306. package/src/basic-languages/r/r.contribution.ts +24 -0
  307. package/src/basic-languages/r/r.test.ts +600 -0
  308. package/src/basic-languages/r/r.ts +263 -0
  309. package/src/basic-languages/razor/razor.contribution.ts +25 -0
  310. package/src/basic-languages/razor/razor.test.ts +175 -0
  311. package/src/basic-languages/razor/razor.ts +571 -0
  312. package/src/basic-languages/redis/redis.contribution.ts +24 -0
  313. package/src/basic-languages/redis/redis.test.ts +306 -0
  314. package/src/basic-languages/redis/redis.ts +309 -0
  315. package/src/basic-languages/redshift/redshift.contribution.ts +24 -0
  316. package/src/basic-languages/redshift/redshift.test.ts +595 -0
  317. package/src/basic-languages/redshift/redshift.ts +815 -0
  318. package/src/basic-languages/restructuredtext/restructuredtext.contribution.ts +24 -0
  319. package/src/basic-languages/restructuredtext/restructuredtext.test.ts +454 -0
  320. package/src/basic-languages/restructuredtext/restructuredtext.ts +198 -0
  321. package/src/basic-languages/ruby/ruby.contribution.ts +25 -0
  322. package/src/basic-languages/ruby/ruby.test.ts +158 -0
  323. package/src/basic-languages/ruby/ruby.ts +590 -0
  324. package/src/basic-languages/rust/rust.contribution.ts +24 -0
  325. package/src/basic-languages/rust/rust.test.ts +208 -0
  326. package/src/basic-languages/rust/rust.ts +361 -0
  327. package/src/basic-languages/sb/sb.contribution.ts +24 -0
  328. package/src/basic-languages/sb/sb.test.ts +320 -0
  329. package/src/basic-languages/sb/sb.ts +134 -0
  330. package/src/basic-languages/scala/scala.contribution.ts +25 -0
  331. package/src/basic-languages/scala/scala.test.ts +727 -0
  332. package/src/basic-languages/scala/scala.ts +413 -0
  333. package/src/basic-languages/scheme/scheme.contribution.ts +24 -0
  334. package/src/basic-languages/scheme/scheme.test.ts +89 -0
  335. package/src/basic-languages/scheme/scheme.ts +128 -0
  336. package/src/basic-languages/scss/scss.contribution.ts +25 -0
  337. package/src/basic-languages/scss/scss.test.ts +2422 -0
  338. package/src/basic-languages/scss/scss.ts +284 -0
  339. package/src/basic-languages/shell/shell.contribution.ts +24 -0
  340. package/src/basic-languages/shell/shell.test.ts +345 -0
  341. package/src/basic-languages/shell/shell.ts +246 -0
  342. package/src/basic-languages/solidity/solidity.contribution.ts +24 -0
  343. package/src/basic-languages/solidity/solidity.test.ts +272 -0
  344. package/src/basic-languages/solidity/solidity.ts +1388 -0
  345. package/src/basic-languages/sophia/sophia.contribution.ts +24 -0
  346. package/src/basic-languages/sophia/sophia.test.ts +302 -0
  347. package/src/basic-languages/sophia/sophia.ts +220 -0
  348. package/src/basic-languages/sparql/sparql.contribution.ts +24 -0
  349. package/src/basic-languages/sparql/sparql.test.ts +187 -0
  350. package/src/basic-languages/sparql/sparql.ts +219 -0
  351. package/src/basic-languages/sql/keywords.js +612 -0
  352. package/src/basic-languages/sql/sql.contribution.ts +24 -0
  353. package/src/basic-languages/sql/sql.test.ts +692 -0
  354. package/src/basic-languages/sql/sql.ts +860 -0
  355. package/src/basic-languages/st/st.contribution.ts +24 -0
  356. package/src/basic-languages/st/st.test.ts +139 -0
  357. package/src/basic-languages/st/st.ts +441 -0
  358. package/src/basic-languages/swift/swift.contribution.ts +25 -0
  359. package/src/basic-languages/swift/swift.test.ts +254 -0
  360. package/src/basic-languages/swift/swift.ts +335 -0
  361. package/src/basic-languages/systemverilog/systemverilog.contribution.ts +39 -0
  362. package/src/basic-languages/systemverilog/systemverilog.test.ts +1267 -0
  363. package/src/basic-languages/systemverilog/systemverilog.ts +606 -0
  364. package/src/basic-languages/tcl/tcl.contribution.ts +24 -0
  365. package/src/basic-languages/tcl/tcl.test.ts +107 -0
  366. package/src/basic-languages/tcl/tcl.ts +259 -0
  367. package/src/basic-languages/test/testRunner.ts +63 -0
  368. package/src/basic-languages/twig/twig.contribution.ts +25 -0
  369. package/src/basic-languages/twig/twig.test.ts +1047 -0
  370. package/src/basic-languages/twig/twig.ts +417 -0
  371. package/src/basic-languages/typescript/typescript.contribution.ts +25 -0
  372. package/src/basic-languages/typescript/typescript.test.ts +973 -0
  373. package/src/basic-languages/typescript/typescript.ts +364 -0
  374. package/src/basic-languages/typespec/typespec.contribution.ts +24 -0
  375. package/src/basic-languages/typespec/typespec.test.ts +500 -0
  376. package/src/basic-languages/typespec/typespec.ts +130 -0
  377. package/src/basic-languages/vb/vb.contribution.ts +24 -0
  378. package/src/basic-languages/vb/vb.test.ts +598 -0
  379. package/src/basic-languages/vb/vb.ts +394 -0
  380. package/src/basic-languages/wgsl/wgsl.contribution.ts +24 -0
  381. package/src/basic-languages/wgsl/wgsl.test.ts +3915 -0
  382. package/src/basic-languages/wgsl/wgsl.ts +485 -0
  383. package/src/basic-languages/xml/xml.contribution.ts +44 -0
  384. package/src/basic-languages/xml/xml.test.ts +706 -0
  385. package/src/basic-languages/xml/xml.ts +106 -0
  386. package/src/basic-languages/yaml/yaml.contribution.ts +25 -0
  387. package/src/basic-languages/yaml/yaml.test.ts +670 -0
  388. package/src/basic-languages/yaml/yaml.ts +236 -0
  389. package/src/fillers/editor.api.d.ts +4 -0
  390. package/src/fillers/monaco-editor-core-amd.ts +11 -0
  391. package/src/fillers/monaco-editor-core.ts +6 -0
  392. package/src/language/common/lspLanguageFeatures.ts +1027 -0
  393. package/src/language/css/css.worker.ts +14 -0
  394. package/src/language/css/cssMode.ts +145 -0
  395. package/src/language/css/cssWorker.ts +239 -0
  396. package/src/language/css/monaco.contribution.ts +362 -0
  397. package/src/language/css/workerManager.ts +90 -0
  398. package/src/language/html/html.worker.ts +14 -0
  399. package/src/language/html/htmlMode.ts +171 -0
  400. package/src/language/html/htmlWorker.ts +164 -0
  401. package/src/language/html/monaco.contribution.ts +329 -0
  402. package/src/language/html/workerManager.ts +90 -0
  403. package/src/language/json/json.worker.ts +14 -0
  404. package/src/language/json/jsonMode.ts +185 -0
  405. package/src/language/json/jsonWorker.ts +235 -0
  406. package/src/language/json/monaco.contribution.ts +372 -0
  407. package/src/language/json/tokenization.ts +273 -0
  408. package/src/language/json/workerManager.ts +91 -0
  409. package/src/language/typescript/languageFeatures.ts +1269 -0
  410. package/src/language/typescript/lib/editor.worker.d.ts +8 -0
  411. package/src/language/typescript/lib/lib.index.ts +97 -0
  412. package/src/language/typescript/lib/lib.ts +97 -0
  413. package/src/language/typescript/lib/typescriptServices.d.ts +11717 -0
  414. package/src/language/typescript/lib/typescriptServices.js +190876 -0
  415. package/src/language/typescript/lib/typescriptServicesMetadata.ts +5 -0
  416. package/src/language/typescript/monaco.contribution.ts +815 -0
  417. package/src/language/typescript/ts.worker.ts +19 -0
  418. package/src/language/typescript/tsMode.ts +176 -0
  419. package/src/language/typescript/tsWorker.ts +525 -0
  420. package/src/language/typescript/workerManager.ts +101 -0
  421. package/src/nls-fix.js +39 -0
  422. package/src/tsconfig.json +14 -0
  423. package/test/manual/cross-origin.html +26 -0
  424. package/test/manual/dev-setup.js +218 -0
  425. package/test/manual/diff.html +20 -0
  426. package/test/manual/diff.js +451 -0
  427. package/test/manual/iframe-inner.html +29 -0
  428. package/test/manual/iframe.html +23 -0
  429. package/test/manual/index.css +14 -0
  430. package/test/manual/index.html +44 -0
  431. package/test/manual/index.js +421 -0
  432. package/test/manual/mouse-fixed.html +31 -0
  433. package/test/manual/mouse-scrollable-body.html +286 -0
  434. package/test/manual/mouse-scrollable-element.html +204 -0
  435. package/test/manual/samples/run-editor-failing-js.txt +44 -0
  436. package/test/manual/samples/run-editor-intellisense-js.txt +33 -0
  437. package/test/manual/samples/run-editor-jquery-min-js.txt +30 -0
  438. package/test/manual/samples/run-editor-korean.txt +10 -0
  439. package/test/manual/samples/run-editor-sample-big-css.txt +1 -0
  440. package/test/manual/samples/run-editor-sample-bom-cs.txt +493 -0
  441. package/test/manual/samples/run-editor-sample-cr-ps1.txt +12 -0
  442. package/test/manual/samples/run-editor-sample-dynamic.txt +50 -0
  443. package/test/manual/samples/run-editor-sample-f12-css.txt +31764 -0
  444. package/test/manual/samples/run-editor-sample-html.txt +23 -0
  445. package/test/manual/samples/run-editor-sample-js.txt +222 -0
  446. package/test/manual/samples/run-editor-sample-msn-js.txt +1 -0
  447. package/test/manual/samples.js +287 -0
  448. package/test/manual/shadow-dom.html +56 -0
  449. package/test/manual/transform.html +29 -0
  450. package/test/manual/typescript/custom-worker.html +210 -0
  451. package/test/manual/typescript/custom-worker.js +59 -0
  452. package/test/manual/typescript/index.html +179 -0
  453. package/test/smoke/amd/index.html +21 -0
  454. package/test/smoke/common.js +11 -0
  455. package/test/smoke/esbuild/index.html +11 -0
  456. package/test/smoke/esbuild/index.js +26 -0
  457. package/test/smoke/package-esbuild.ts +60 -0
  458. package/test/smoke/package-vite.ts +19 -0
  459. package/test/smoke/package-webpack.ts +56 -0
  460. package/test/smoke/parcel/index.html +11 -0
  461. package/test/smoke/parcel/index.js +41 -0
  462. package/test/smoke/parcel/package.json +6 -0
  463. package/test/smoke/runner.js +94 -0
  464. package/test/smoke/smoke.test.js +215 -0
  465. package/test/smoke/vite/index.html +10 -0
  466. package/test/smoke/vite/index.js +31 -0
  467. package/test/smoke/webpack/index.html +10 -0
  468. package/test/smoke/webpack/index.js +4 -0
  469. package/test/unit/all.js +70 -0
  470. package/test/unit/setup.js +34 -0
  471. package/webpack-plugin/LICENSE +21 -0
  472. package/webpack-plugin/README.md +116 -0
  473. package/webpack-plugin/package-lock.json +3132 -0
  474. package/webpack-plugin/package.json +45 -0
  475. package/webpack-plugin/tsconfig.json +11 -0
  476. package/website/.prettierrc.json +6 -0
  477. package/website/index/samples/sample.mdx.txt +92 -0
  478. package/website/package.json +60 -0
  479. package/website/scripts/check-playground-samples-js.ts +58 -0
  480. package/website/src/monaco-loader.ts +111 -0
  481. package/website/src/runner/debug.ts +75 -0
  482. package/website/src/runner/index.ts +104 -0
  483. package/website/src/runner/style.scss +35 -0
  484. package/website/src/shared.ts +37 -0
  485. package/website/src/tsconfig.json +19 -0
  486. package/website/src/types.d.ts +13 -0
  487. package/website/src/website/bootstrap.scss +6 -0
  488. package/website/src/website/code-oss.svg +1 -0
  489. package/website/src/website/components/Loader.tsx +40 -0
  490. package/website/src/website/components/Nav.tsx +75 -0
  491. package/website/src/website/components/Page.tsx +11 -0
  492. package/website/src/website/components/Radio.tsx +23 -0
  493. package/website/src/website/components/Select.tsx +75 -0
  494. package/website/src/website/components/TextBox.tsx +21 -0
  495. package/website/src/website/components/bootstrap.tsx +32 -0
  496. package/website/src/website/components/monaco/MonacoEditor.tsx +275 -0
  497. package/website/src/website/components/monaco/MonacoLoader.tsx +39 -0
  498. package/website/src/website/data/diff-sample/modified.txt +212 -0
  499. package/website/src/website/data/diff-sample/original.txt +215 -0
  500. package/website/src/website/data/home-samples/sample.abap.txt +29 -0
  501. package/website/src/website/data/home-samples/sample.aes.txt +38 -0
  502. package/website/src/website/data/home-samples/sample.apex.txt +7 -0
  503. package/website/src/website/data/home-samples/sample.azcli.txt +5 -0
  504. package/website/src/website/data/home-samples/sample.bat.txt +13 -0
  505. package/website/src/website/data/home-samples/sample.bicep.txt +29 -0
  506. package/website/src/website/data/home-samples/sample.c.txt +3463 -0
  507. package/website/src/website/data/home-samples/sample.cameligo.txt +17 -0
  508. package/website/src/website/data/home-samples/sample.clojure.txt +54 -0
  509. package/website/src/website/data/home-samples/sample.coffeescript.txt +28 -0
  510. package/website/src/website/data/home-samples/sample.cpp.txt +246 -0
  511. package/website/src/website/data/home-samples/sample.csharp.txt +38 -0
  512. package/website/src/website/data/home-samples/sample.csp.txt +1 -0
  513. package/website/src/website/data/home-samples/sample.css.txt +828 -0
  514. package/website/src/website/data/home-samples/sample.cypher.txt +3 -0
  515. package/website/src/website/data/home-samples/sample.dart.txt +45 -0
  516. package/website/src/website/data/home-samples/sample.dockerfile.txt +32 -0
  517. package/website/src/website/data/home-samples/sample.ecl.txt +7 -0
  518. package/website/src/website/data/home-samples/sample.elixir.txt +80 -0
  519. package/website/src/website/data/home-samples/sample.flow9.txt +14 -0
  520. package/website/src/website/data/home-samples/sample.freemarker2.tag-angle.interpolation-bracket.txt +61 -0
  521. package/website/src/website/data/home-samples/sample.freemarker2.tag-angle.interpolation-dollar.txt +61 -0
  522. package/website/src/website/data/home-samples/sample.freemarker2.tag-auto.interpolation-bracket.txt +65 -0
  523. package/website/src/website/data/home-samples/sample.freemarker2.tag-auto.interpolation-dollar.txt +65 -0
  524. package/website/src/website/data/home-samples/sample.freemarker2.tag-bracket.interpolation-bracket.txt +61 -0
  525. package/website/src/website/data/home-samples/sample.freemarker2.tag-bracket.interpolation-dollar.txt +61 -0
  526. package/website/src/website/data/home-samples/sample.freemarker2.txt +61 -0
  527. package/website/src/website/data/home-samples/sample.fsharp.txt +8 -0
  528. package/website/src/website/data/home-samples/sample.go.txt +111 -0
  529. package/website/src/website/data/home-samples/sample.graphql.txt +263 -0
  530. package/website/src/website/data/home-samples/sample.handlebars.txt +31 -0
  531. package/website/src/website/data/home-samples/sample.hcl.txt +48 -0
  532. package/website/src/website/data/home-samples/sample.html.txt +100 -0
  533. package/website/src/website/data/home-samples/sample.ini.txt +15 -0
  534. package/website/src/website/data/home-samples/sample.java.txt +54 -0
  535. package/website/src/website/data/home-samples/sample.javascript.txt +214 -0
  536. package/website/src/website/data/home-samples/sample.json.txt +68 -0
  537. package/website/src/website/data/home-samples/sample.julia.txt +23 -0
  538. package/website/src/website/data/home-samples/sample.kotlin.txt +28 -0
  539. package/website/src/website/data/home-samples/sample.less.txt +46 -0
  540. package/website/src/website/data/home-samples/sample.lex.txt +21 -0
  541. package/website/src/website/data/home-samples/sample.lexon.txt +17 -0
  542. package/website/src/website/data/home-samples/sample.liquid.txt +16 -0
  543. package/website/src/website/data/home-samples/sample.lua.txt +12 -0
  544. package/website/src/website/data/home-samples/sample.m3.txt +5 -0
  545. package/website/src/website/data/home-samples/sample.markdown.txt +104 -0
  546. package/website/src/website/data/home-samples/sample.mdx.txt +91 -0
  547. package/website/src/website/data/home-samples/sample.mips.txt +13 -0
  548. package/website/src/website/data/home-samples/sample.msdax.txt +1 -0
  549. package/website/src/website/data/home-samples/sample.mysql.txt +8 -0
  550. package/website/src/website/data/home-samples/sample.objective-c.txt +52 -0
  551. package/website/src/website/data/home-samples/sample.pascal.txt +28 -0
  552. package/website/src/website/data/home-samples/sample.pascaligo.txt +20 -0
  553. package/website/src/website/data/home-samples/sample.pebble.txt +54 -0
  554. package/website/src/website/data/home-samples/sample.perl.txt +18 -0
  555. package/website/src/website/data/home-samples/sample.pgsql.txt +8 -0
  556. package/website/src/website/data/home-samples/sample.php.txt +82 -0
  557. package/website/src/website/data/home-samples/sample.pla.txt +4 -0
  558. package/website/src/website/data/home-samples/sample.plaintext.txt +9 -0
  559. package/website/src/website/data/home-samples/sample.postiats.txt +64 -0
  560. package/website/src/website/data/home-samples/sample.powerquery.txt +12 -0
  561. package/website/src/website/data/home-samples/sample.powershell.txt +30 -0
  562. package/website/src/website/data/home-samples/sample.proto.txt +11 -0
  563. package/website/src/website/data/home-samples/sample.pug.txt +18 -0
  564. package/website/src/website/data/home-samples/sample.python.txt +13 -0
  565. package/website/src/website/data/home-samples/sample.qsharp.txt +45 -0
  566. package/website/src/website/data/home-samples/sample.r.txt +41 -0
  567. package/website/src/website/data/home-samples/sample.razor.txt +46 -0
  568. package/website/src/website/data/home-samples/sample.redis.txt +4 -0
  569. package/website/src/website/data/home-samples/sample.redshift.txt +9 -0
  570. package/website/src/website/data/home-samples/sample.restructuredtext.txt +26 -0
  571. package/website/src/website/data/home-samples/sample.ruby.txt +21 -0
  572. package/website/src/website/data/home-samples/sample.rust.txt +29 -0
  573. package/website/src/website/data/home-samples/sample.sb.txt +10 -0
  574. package/website/src/website/data/home-samples/sample.scala.txt +53 -0
  575. package/website/src/website/data/home-samples/sample.scheme.txt +105 -0
  576. package/website/src/website/data/home-samples/sample.scss.txt +37 -0
  577. package/website/src/website/data/home-samples/sample.shell.txt +42 -0
  578. package/website/src/website/data/home-samples/sample.sol.txt +139 -0
  579. package/website/src/website/data/home-samples/sample.sparql.txt +7 -0
  580. package/website/src/website/data/home-samples/sample.sql.txt +52 -0
  581. package/website/src/website/data/home-samples/sample.st.txt +34 -0
  582. package/website/src/website/data/home-samples/sample.swift.txt +50 -0
  583. package/website/src/website/data/home-samples/sample.systemverilog.txt +28 -0
  584. package/website/src/website/data/home-samples/sample.tcl.txt +18 -0
  585. package/website/src/website/data/home-samples/sample.twig.txt +12 -0
  586. package/website/src/website/data/home-samples/sample.typescript.txt +124 -0
  587. package/website/src/website/data/home-samples/sample.typespec.txt +71 -0
  588. package/website/src/website/data/home-samples/sample.vb.txt +59 -0
  589. package/website/src/website/data/home-samples/sample.verilog.txt +35 -0
  590. package/website/src/website/data/home-samples/sample.wgsl.txt +48 -0
  591. package/website/src/website/data/home-samples/sample.xml.txt +14 -0
  592. package/website/src/website/data/home-samples/sample.yaml.txt +14 -0
  593. package/website/src/website/data/playground-samples/all.js +196 -0
  594. package/website/src/website/data/playground-samples/creating-the-diffeditor/chapter.json +3 -0
  595. package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.css +0 -0
  596. package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.html +1 -0
  597. package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.js +20 -0
  598. package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.json +3 -0
  599. package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.css +0 -0
  600. package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.html +1 -0
  601. package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.js +23 -0
  602. package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.json +3 -0
  603. package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.css +0 -0
  604. package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.html +1 -0
  605. package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.js +20 -0
  606. package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.json +3 -0
  607. package/website/src/website/data/playground-samples/creating-the-editor/chapter.json +4 -0
  608. package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.css +0 -0
  609. package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.html +1 -0
  610. package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.js +19 -0
  611. package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.json +3 -0
  612. package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.css +0 -0
  613. package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.html +1 -0
  614. package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.js +13 -0
  615. package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.json +3 -0
  616. package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.css +0 -0
  617. package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.html +1 -0
  618. package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js +10 -0
  619. package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.json +4 -0
  620. package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.css +0 -0
  621. package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.html +35 -0
  622. package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.js +4 -0
  623. package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.json +3 -0
  624. package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.css +0 -0
  625. package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.html +8 -0
  626. package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js +35 -0
  627. package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.json +4 -0
  628. package/website/src/website/data/playground-samples/customizing-the-appearence/chapter.json +3 -0
  629. package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.css +0 -0
  630. package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.html +1 -0
  631. package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.js +150 -0
  632. package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.json +3 -0
  633. package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.css +13 -0
  634. package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.html +1 -0
  635. package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.js +32 -0
  636. package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.json +3 -0
  637. package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.css +0 -0
  638. package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.html +1 -0
  639. package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.js +40 -0
  640. package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.json +3 -0
  641. package/website/src/website/data/playground-samples/extending-language-services/chapter.json +3 -0
  642. package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.css +0 -0
  643. package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.html +1 -0
  644. package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.js +39 -0
  645. package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.json +3 -0
  646. package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.css +0 -0
  647. package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.html +1 -0
  648. package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js +71 -0
  649. package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.json +3 -0
  650. package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.css +0 -0
  651. package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.html +1 -0
  652. package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.js +69 -0
  653. package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.json +3 -0
  654. package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.css +0 -0
  655. package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.html +1 -0
  656. package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.js +46 -0
  657. package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.json +3 -0
  658. package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.css +0 -0
  659. package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.html +1 -0
  660. package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.js +42 -0
  661. package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.json +3 -0
  662. package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.css +0 -0
  663. package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.html +1 -0
  664. package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.js +137 -0
  665. package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.json +3 -0
  666. package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.css +0 -0
  667. package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.html +1 -0
  668. package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.js +74 -0
  669. package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.json +3 -0
  670. package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.css +0 -0
  671. package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.html +1 -0
  672. package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.js +62 -0
  673. package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.json +3 -0
  674. package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.css +0 -0
  675. package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.html +1 -0
  676. package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.js +47 -0
  677. package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.json +3 -0
  678. package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.css +0 -0
  679. package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.html +1 -0
  680. package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.js +50 -0
  681. package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.json +3 -0
  682. package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.css +0 -0
  683. package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.html +1 -0
  684. package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.js +168 -0
  685. package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.json +3 -0
  686. package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.css +0 -0
  687. package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.html +1 -0
  688. package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.js +480 -0
  689. package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.json +3 -0
  690. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.css +0 -0
  691. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.html +1 -0
  692. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.js +43 -0
  693. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.json +3 -0
  694. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.css +0 -0
  695. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.html +1 -0
  696. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.js +49 -0
  697. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.json +3 -0
  698. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.css +0 -0
  699. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.html +1 -0
  700. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.js +52 -0
  701. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.json +3 -0
  702. package/website/src/website/data/playground-samples/interacting-with-the-editor/chapter.json +3 -0
  703. package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.css +0 -0
  704. package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.html +1 -0
  705. package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.js +37 -0
  706. package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.json +3 -0
  707. package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.css +13 -0
  708. package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.html +1 -0
  709. package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.js +30 -0
  710. package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.json +3 -0
  711. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.css +0 -0
  712. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.html +1 -0
  713. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.js +11 -0
  714. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.json +3 -0
  715. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.css +6 -0
  716. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.html +5 -0
  717. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.js +114 -0
  718. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.json +3 -0
  719. package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.css +7 -0
  720. package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.html +1 -0
  721. package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.js +30 -0
  722. package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.json +3 -0
  723. package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.css +0 -0
  724. package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.html +1 -0
  725. package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.js +41 -0
  726. package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.json +3 -0
  727. package/website/src/website/index.tsx +10 -0
  728. package/website/src/website/monaco-loader-chunk.ts +15 -0
  729. package/website/src/website/monacoEditorVersion.ts +8 -0
  730. package/website/src/website/pages/App.tsx +21 -0
  731. package/website/src/website/pages/DocsPage.tsx +103 -0
  732. package/website/src/website/pages/MonarchPage.tsx +16 -0
  733. package/website/src/website/pages/home/Home.tsx +249 -0
  734. package/website/src/website/pages/playground/BisectModel.ts +161 -0
  735. package/website/src/website/pages/playground/LocationModel.ts +216 -0
  736. package/website/src/website/pages/playground/PlaygroundModel.ts +355 -0
  737. package/website/src/website/pages/playground/PlaygroundPage.tsx +31 -0
  738. package/website/src/website/pages/playground/PlaygroundPageContent.tsx +587 -0
  739. package/website/src/website/pages/playground/Preview.tsx +129 -0
  740. package/website/src/website/pages/playground/SettingsDialog.tsx +412 -0
  741. package/website/src/website/pages/playground/SettingsModel.ts +198 -0
  742. package/website/src/website/pages/playground/Source.ts +107 -0
  743. package/website/src/website/pages/playground/getNpmVersionsSync.ts +450 -0
  744. package/website/src/website/pages/playground/playgroundExamples.tsx +88 -0
  745. package/website/src/website/pages/playground/utils.ts +28 -0
  746. package/website/src/website/pages/routes.ts +28 -0
  747. package/website/src/website/style.scss +96 -0
  748. package/website/src/website/utils/Debouncer.ts +28 -0
  749. package/website/src/website/utils/ObservableHistory.ts +89 -0
  750. package/website/src/website/utils/ObservablePromise.ts +49 -0
  751. package/website/src/website/utils/hotComponent.tsx +49 -0
  752. package/website/src/website/utils/lzmaCompressor.ts +39 -0
  753. package/website/src/website/utils/ref.ts +39 -0
  754. package/website/src/website/utils/types.d.ts +28 -0
  755. package/website/src/website/utils/utils.ts +58 -0
  756. package/website/static/monarch/monarch-34px.png +0 -0
  757. package/website/static/monarch/monarch.css +297 -0
  758. package/website/static/monarch/monarch.js +178 -0
  759. package/website/static/monarch-static.html +5345 -0
  760. package/website/tsconfig.json +16 -0
  761. package/website/tslint.json +6 -0
  762. package/website/typedoc/tsconfig.json +8 -0
  763. package/website/typedoc/typedoc.json +11 -0
  764. package/website/vscode-web-editors.tgz +0 -0
  765. package/website/webpack.config.ts +151 -0
  766. package/website/yarn.lock +3612 -0
@@ -0,0 +1,3915 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation, Google LLC. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ import { testTokenization, ITestItem } from '../test/testRunner';
7
+
8
+ const cases: ITestItem[][] = [
9
+ // address space
10
+ [
11
+ {
12
+ line: 'alias a=ptr<function,i32>;',
13
+ tokens: [
14
+ { startIndex: 0, type: 'keyword.wgsl' },
15
+ { startIndex: 5, type: 'white.wgsl' },
16
+ { startIndex: 6, type: 'identifier.wgsl' },
17
+ { startIndex: 7, type: 'operator.wgsl' },
18
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
19
+ { startIndex: 11, type: 'operator.wgsl' },
20
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
21
+ { startIndex: 20, type: 'delimiter.wgsl' },
22
+ { startIndex: 21, type: 'variable.predefined.wgsl' },
23
+ { startIndex: 24, type: 'delimiter.wgsl' }
24
+ ]
25
+ },
26
+ {
27
+ line: 'alias b=ptr<private,i32>;',
28
+ tokens: [
29
+ { startIndex: 0, type: 'keyword.wgsl' },
30
+ { startIndex: 5, type: 'white.wgsl' },
31
+ { startIndex: 6, type: 'identifier.wgsl' },
32
+ { startIndex: 7, type: 'operator.wgsl' },
33
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
34
+ { startIndex: 11, type: 'operator.wgsl' },
35
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
36
+ { startIndex: 19, type: 'delimiter.wgsl' },
37
+ { startIndex: 20, type: 'variable.predefined.wgsl' },
38
+ { startIndex: 23, type: 'delimiter.wgsl' }
39
+ ]
40
+ },
41
+ {
42
+ line: 'alias c=ptr<workgroup,i32>;',
43
+ tokens: [
44
+ { startIndex: 0, type: 'keyword.wgsl' },
45
+ { startIndex: 5, type: 'white.wgsl' },
46
+ { startIndex: 6, type: 'identifier.wgsl' },
47
+ { startIndex: 7, type: 'operator.wgsl' },
48
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
49
+ { startIndex: 11, type: 'operator.wgsl' },
50
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
51
+ { startIndex: 21, type: 'delimiter.wgsl' },
52
+ { startIndex: 22, type: 'variable.predefined.wgsl' },
53
+ { startIndex: 25, type: 'delimiter.wgsl' }
54
+ ]
55
+ },
56
+ {
57
+ line: 'alias d=ptr<uniform,i32>;',
58
+ tokens: [
59
+ { startIndex: 0, type: 'keyword.wgsl' },
60
+ { startIndex: 5, type: 'white.wgsl' },
61
+ { startIndex: 6, type: 'identifier.wgsl' },
62
+ { startIndex: 7, type: 'operator.wgsl' },
63
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
64
+ { startIndex: 11, type: 'operator.wgsl' },
65
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
66
+ { startIndex: 19, type: 'delimiter.wgsl' },
67
+ { startIndex: 20, type: 'variable.predefined.wgsl' },
68
+ { startIndex: 23, type: 'delimiter.wgsl' }
69
+ ]
70
+ },
71
+ {
72
+ line: 'alias e=ptr<storage,i32>;',
73
+ tokens: [
74
+ { startIndex: 0, type: 'keyword.wgsl' },
75
+ { startIndex: 5, type: 'white.wgsl' },
76
+ { startIndex: 6, type: 'identifier.wgsl' },
77
+ { startIndex: 7, type: 'operator.wgsl' },
78
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
79
+ { startIndex: 11, type: 'operator.wgsl' },
80
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
81
+ { startIndex: 19, type: 'delimiter.wgsl' },
82
+ { startIndex: 20, type: 'variable.predefined.wgsl' },
83
+ { startIndex: 23, type: 'delimiter.wgsl' }
84
+ ]
85
+ }
86
+ ],
87
+ // attribute
88
+ [
89
+ {
90
+ line: '@id(0) override x:i32 = 1;',
91
+ tokens: [
92
+ { startIndex: 0, type: 'annotation.wgsl' },
93
+ { startIndex: 3, type: 'delimiter.parenthesis.wgsl' },
94
+ { startIndex: 4, type: 'number.wgsl' },
95
+ { startIndex: 5, type: 'delimiter.parenthesis.wgsl' },
96
+ { startIndex: 6, type: 'white.wgsl' },
97
+ { startIndex: 7, type: 'keyword.wgsl' },
98
+ { startIndex: 15, type: 'white.wgsl' },
99
+ { startIndex: 16, type: 'identifier.wgsl' },
100
+ { startIndex: 17, type: 'delimiter.wgsl' },
101
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
102
+ { startIndex: 21, type: 'white.wgsl' },
103
+ { startIndex: 22, type: 'operator.wgsl' },
104
+ { startIndex: 23, type: 'white.wgsl' },
105
+ { startIndex: 24, type: 'number.wgsl' },
106
+ { startIndex: 25, type: 'delimiter.wgsl' }
107
+ ]
108
+ },
109
+ {
110
+ line: '@ id(1) override y:i32 = 2;',
111
+ tokens: [
112
+ { startIndex: 0, type: 'annotation.wgsl' },
113
+ { startIndex: 1, type: 'white.wgsl' },
114
+ { startIndex: 2, type: 'annotation.wgsl' },
115
+ { startIndex: 4, type: 'delimiter.parenthesis.wgsl' },
116
+ { startIndex: 5, type: 'number.wgsl' },
117
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
118
+ { startIndex: 7, type: 'white.wgsl' },
119
+ { startIndex: 8, type: 'keyword.wgsl' },
120
+ { startIndex: 16, type: 'white.wgsl' },
121
+ { startIndex: 17, type: 'identifier.wgsl' },
122
+ { startIndex: 18, type: 'delimiter.wgsl' },
123
+ { startIndex: 19, type: 'variable.predefined.wgsl' },
124
+ { startIndex: 22, type: 'white.wgsl' },
125
+ { startIndex: 23, type: 'operator.wgsl' },
126
+ { startIndex: 24, type: 'white.wgsl' },
127
+ { startIndex: 25, type: 'number.wgsl' },
128
+ { startIndex: 26, type: 'delimiter.wgsl' }
129
+ ]
130
+ },
131
+ {
132
+ line: '@//comment',
133
+ tokens: [
134
+ { startIndex: 0, type: 'annotation.wgsl' },
135
+ { startIndex: 1, type: 'comment.wgsl' }
136
+ ]
137
+ },
138
+ {
139
+ line: 'id(1) override z:i32 = 3;',
140
+ tokens: [
141
+ { startIndex: 0, type: 'annotation.wgsl' },
142
+ { startIndex: 2, type: 'delimiter.parenthesis.wgsl' },
143
+ { startIndex: 3, type: 'number.wgsl' },
144
+ { startIndex: 4, type: 'delimiter.parenthesis.wgsl' },
145
+ { startIndex: 5, type: 'white.wgsl' },
146
+ { startIndex: 6, type: 'keyword.wgsl' },
147
+ { startIndex: 14, type: 'white.wgsl' },
148
+ { startIndex: 15, type: 'identifier.wgsl' },
149
+ { startIndex: 16, type: 'delimiter.wgsl' },
150
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
151
+ { startIndex: 20, type: 'white.wgsl' },
152
+ { startIndex: 21, type: 'operator.wgsl' },
153
+ { startIndex: 22, type: 'white.wgsl' },
154
+ { startIndex: 23, type: 'number.wgsl' },
155
+ { startIndex: 24, type: 'delimiter.wgsl' }
156
+ ]
157
+ },
158
+ {
159
+ line: '@must_use fn foo() -> i32 { return 32; }',
160
+ tokens: [
161
+ { startIndex: 0, type: 'annotation.wgsl' },
162
+ { startIndex: 9, type: 'white.wgsl' },
163
+ { startIndex: 10, type: 'keyword.wgsl' },
164
+ { startIndex: 12, type: 'white.wgsl' },
165
+ { startIndex: 13, type: 'identifier.wgsl' },
166
+ { startIndex: 16, type: 'delimiter.parenthesis.wgsl' },
167
+ { startIndex: 18, type: 'white.wgsl' },
168
+ { startIndex: 19, type: 'operator.wgsl' },
169
+ { startIndex: 21, type: 'white.wgsl' },
170
+ { startIndex: 22, type: 'variable.predefined.wgsl' },
171
+ { startIndex: 25, type: 'white.wgsl' },
172
+ { startIndex: 26, type: 'delimiter.curly.wgsl' },
173
+ { startIndex: 27, type: 'white.wgsl' },
174
+ { startIndex: 28, type: 'keyword.wgsl' },
175
+ { startIndex: 34, type: 'white.wgsl' },
176
+ { startIndex: 35, type: 'number.wgsl' },
177
+ { startIndex: 37, type: 'delimiter.wgsl' },
178
+ { startIndex: 38, type: 'white.wgsl' },
179
+ { startIndex: 39, type: 'delimiter.curly.wgsl' }
180
+ ]
181
+ }
182
+ ],
183
+ // block comment
184
+ [
185
+ {
186
+ line: ' /**/',
187
+ tokens: [
188
+ { startIndex: 0, type: 'white.wgsl' },
189
+ { startIndex: 1, type: 'comment.wgsl' }
190
+ ]
191
+ },
192
+ {
193
+ line: ' /*block with newline',
194
+ tokens: [
195
+ { startIndex: 0, type: 'white.wgsl' },
196
+ { startIndex: 1, type: 'comment.wgsl' }
197
+ ]
198
+ },
199
+ { line: ' */', tokens: [{ startIndex: 0, type: 'comment.wgsl' }] },
200
+ {
201
+ line: ' /*block with line',
202
+ tokens: [
203
+ { startIndex: 0, type: 'white.wgsl' },
204
+ { startIndex: 1, type: 'comment.wgsl' }
205
+ ]
206
+ },
207
+ { line: ' ending comment// */', tokens: [{ startIndex: 0, type: 'comment.wgsl' }] },
208
+ {
209
+ line: ' /* nested /*',
210
+ tokens: [
211
+ { startIndex: 0, type: 'white.wgsl' },
212
+ { startIndex: 1, type: 'comment.wgsl' }
213
+ ]
214
+ },
215
+ { line: ' */', tokens: [{ startIndex: 0, type: 'comment.wgsl' }] },
216
+ { line: ' */', tokens: [{ startIndex: 0, type: 'comment.wgsl' }] }
217
+ ],
218
+ // bool types
219
+ [
220
+ {
221
+ line: 'alias boolean=bool;',
222
+ tokens: [
223
+ { startIndex: 0, type: 'keyword.wgsl' },
224
+ { startIndex: 5, type: 'white.wgsl' },
225
+ { startIndex: 6, type: 'identifier.wgsl' },
226
+ { startIndex: 13, type: 'operator.wgsl' },
227
+ { startIndex: 14, type: 'variable.predefined.wgsl' },
228
+ { startIndex: 18, type: 'delimiter.wgsl' }
229
+ ]
230
+ },
231
+ {
232
+ line: 'alias bvec2=vec2<bool>;',
233
+ tokens: [
234
+ { startIndex: 0, type: 'keyword.wgsl' },
235
+ { startIndex: 5, type: 'white.wgsl' },
236
+ { startIndex: 6, type: 'identifier.wgsl' },
237
+ { startIndex: 11, type: 'operator.wgsl' },
238
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
239
+ { startIndex: 16, type: 'operator.wgsl' },
240
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
241
+ { startIndex: 21, type: 'delimiter.wgsl' }
242
+ ]
243
+ },
244
+ {
245
+ line: 'alias bvec3=vec3<bool>;',
246
+ tokens: [
247
+ { startIndex: 0, type: 'keyword.wgsl' },
248
+ { startIndex: 5, type: 'white.wgsl' },
249
+ { startIndex: 6, type: 'identifier.wgsl' },
250
+ { startIndex: 11, type: 'operator.wgsl' },
251
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
252
+ { startIndex: 16, type: 'operator.wgsl' },
253
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
254
+ { startIndex: 21, type: 'delimiter.wgsl' }
255
+ ]
256
+ },
257
+ {
258
+ line: 'alias bvec4=vec4<bool>;',
259
+ tokens: [
260
+ { startIndex: 0, type: 'keyword.wgsl' },
261
+ { startIndex: 5, type: 'white.wgsl' },
262
+ { startIndex: 6, type: 'identifier.wgsl' },
263
+ { startIndex: 11, type: 'operator.wgsl' },
264
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
265
+ { startIndex: 16, type: 'operator.wgsl' },
266
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
267
+ { startIndex: 21, type: 'delimiter.wgsl' }
268
+ ]
269
+ }
270
+ ],
271
+ // brackets
272
+ [
273
+ {
274
+ line: 'const one = array(1)[0];',
275
+ tokens: [
276
+ { startIndex: 0, type: 'keyword.wgsl' },
277
+ { startIndex: 5, type: 'white.wgsl' },
278
+ { startIndex: 6, type: 'identifier.wgsl' },
279
+ { startIndex: 9, type: 'white.wgsl' },
280
+ { startIndex: 10, type: 'operator.wgsl' },
281
+ { startIndex: 11, type: 'white.wgsl' },
282
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
283
+ { startIndex: 17, type: 'delimiter.parenthesis.wgsl' },
284
+ { startIndex: 18, type: 'number.wgsl' },
285
+ { startIndex: 19, type: 'delimiter.parenthesis.wgsl' },
286
+ { startIndex: 20, type: 'delimiter.square.wgsl' },
287
+ { startIndex: 21, type: 'number.wgsl' },
288
+ { startIndex: 22, type: 'delimiter.square.wgsl' },
289
+ { startIndex: 23, type: 'delimiter.wgsl' }
290
+ ]
291
+ },
292
+ {
293
+ line: 'fn none() {}',
294
+ tokens: [
295
+ { startIndex: 0, type: 'keyword.wgsl' },
296
+ { startIndex: 2, type: 'white.wgsl' },
297
+ { startIndex: 3, type: 'identifier.wgsl' },
298
+ { startIndex: 7, type: 'delimiter.parenthesis.wgsl' },
299
+ { startIndex: 9, type: 'white.wgsl' },
300
+ { startIndex: 10, type: 'delimiter.curly.wgsl' }
301
+ ]
302
+ }
303
+ ],
304
+ // const numbers
305
+ [
306
+ {
307
+ line: 'const a = 0;',
308
+ tokens: [
309
+ { startIndex: 0, type: 'keyword.wgsl' },
310
+ { startIndex: 5, type: 'white.wgsl' },
311
+ { startIndex: 6, type: 'identifier.wgsl' },
312
+ { startIndex: 7, type: 'white.wgsl' },
313
+ { startIndex: 8, type: 'operator.wgsl' },
314
+ { startIndex: 9, type: 'white.wgsl' },
315
+ { startIndex: 10, type: 'number.wgsl' },
316
+ { startIndex: 11, type: 'delimiter.wgsl' }
317
+ ]
318
+ },
319
+ {
320
+ line: 'const au = 0u;',
321
+ tokens: [
322
+ { startIndex: 0, type: 'keyword.wgsl' },
323
+ { startIndex: 5, type: 'white.wgsl' },
324
+ { startIndex: 6, type: 'identifier.wgsl' },
325
+ { startIndex: 8, type: 'white.wgsl' },
326
+ { startIndex: 9, type: 'operator.wgsl' },
327
+ { startIndex: 10, type: 'white.wgsl' },
328
+ { startIndex: 11, type: 'number.wgsl' },
329
+ { startIndex: 13, type: 'delimiter.wgsl' }
330
+ ]
331
+ },
332
+ {
333
+ line: 'const ai = 0i;',
334
+ tokens: [
335
+ { startIndex: 0, type: 'keyword.wgsl' },
336
+ { startIndex: 5, type: 'white.wgsl' },
337
+ { startIndex: 6, type: 'identifier.wgsl' },
338
+ { startIndex: 8, type: 'white.wgsl' },
339
+ { startIndex: 9, type: 'operator.wgsl' },
340
+ { startIndex: 10, type: 'white.wgsl' },
341
+ { startIndex: 11, type: 'number.wgsl' },
342
+ { startIndex: 13, type: 'delimiter.wgsl' }
343
+ ]
344
+ },
345
+ {
346
+ line: 'const b = 12345;',
347
+ tokens: [
348
+ { startIndex: 0, type: 'keyword.wgsl' },
349
+ { startIndex: 5, type: 'white.wgsl' },
350
+ { startIndex: 6, type: 'identifier.wgsl' },
351
+ { startIndex: 7, type: 'white.wgsl' },
352
+ { startIndex: 8, type: 'operator.wgsl' },
353
+ { startIndex: 9, type: 'white.wgsl' },
354
+ { startIndex: 10, type: 'number.wgsl' },
355
+ { startIndex: 15, type: 'delimiter.wgsl' }
356
+ ]
357
+ },
358
+ {
359
+ line: 'const bu = 12345u;',
360
+ tokens: [
361
+ { startIndex: 0, type: 'keyword.wgsl' },
362
+ { startIndex: 5, type: 'white.wgsl' },
363
+ { startIndex: 6, type: 'identifier.wgsl' },
364
+ { startIndex: 8, type: 'white.wgsl' },
365
+ { startIndex: 9, type: 'operator.wgsl' },
366
+ { startIndex: 10, type: 'white.wgsl' },
367
+ { startIndex: 11, type: 'number.wgsl' },
368
+ { startIndex: 17, type: 'delimiter.wgsl' }
369
+ ]
370
+ },
371
+ {
372
+ line: 'const bi= 12345i;',
373
+ tokens: [
374
+ { startIndex: 0, type: 'keyword.wgsl' },
375
+ { startIndex: 5, type: 'white.wgsl' },
376
+ { startIndex: 6, type: 'identifier.wgsl' },
377
+ { startIndex: 8, type: 'operator.wgsl' },
378
+ { startIndex: 9, type: 'white.wgsl' },
379
+ { startIndex: 10, type: 'number.wgsl' },
380
+ { startIndex: 16, type: 'delimiter.wgsl' }
381
+ ]
382
+ },
383
+ {
384
+ line: 'const c = 0x0;',
385
+ tokens: [
386
+ { startIndex: 0, type: 'keyword.wgsl' },
387
+ { startIndex: 5, type: 'white.wgsl' },
388
+ { startIndex: 6, type: 'identifier.wgsl' },
389
+ { startIndex: 7, type: 'white.wgsl' },
390
+ { startIndex: 8, type: 'operator.wgsl' },
391
+ { startIndex: 9, type: 'white.wgsl' },
392
+ { startIndex: 10, type: 'number.hex.wgsl' },
393
+ { startIndex: 13, type: 'delimiter.wgsl' }
394
+ ]
395
+ },
396
+ {
397
+ line: 'const cu = 0x0u;',
398
+ tokens: [
399
+ { startIndex: 0, type: 'keyword.wgsl' },
400
+ { startIndex: 5, type: 'white.wgsl' },
401
+ { startIndex: 6, type: 'identifier.wgsl' },
402
+ { startIndex: 8, type: 'white.wgsl' },
403
+ { startIndex: 9, type: 'operator.wgsl' },
404
+ { startIndex: 10, type: 'white.wgsl' },
405
+ { startIndex: 11, type: 'number.hex.wgsl' },
406
+ { startIndex: 15, type: 'delimiter.wgsl' }
407
+ ]
408
+ },
409
+ {
410
+ line: 'const ci = 0x0i;',
411
+ tokens: [
412
+ { startIndex: 0, type: 'keyword.wgsl' },
413
+ { startIndex: 5, type: 'white.wgsl' },
414
+ { startIndex: 6, type: 'identifier.wgsl' },
415
+ { startIndex: 8, type: 'white.wgsl' },
416
+ { startIndex: 9, type: 'operator.wgsl' },
417
+ { startIndex: 10, type: 'white.wgsl' },
418
+ { startIndex: 11, type: 'number.hex.wgsl' },
419
+ { startIndex: 15, type: 'delimiter.wgsl' }
420
+ ]
421
+ },
422
+ {
423
+ line: 'const d = 0x12345;',
424
+ tokens: [
425
+ { startIndex: 0, type: 'keyword.wgsl' },
426
+ { startIndex: 5, type: 'white.wgsl' },
427
+ { startIndex: 6, type: 'identifier.wgsl' },
428
+ { startIndex: 7, type: 'white.wgsl' },
429
+ { startIndex: 8, type: 'operator.wgsl' },
430
+ { startIndex: 9, type: 'white.wgsl' },
431
+ { startIndex: 10, type: 'number.hex.wgsl' },
432
+ { startIndex: 17, type: 'delimiter.wgsl' }
433
+ ]
434
+ },
435
+ {
436
+ line: 'const di = 0x12345i;',
437
+ tokens: [
438
+ { startIndex: 0, type: 'keyword.wgsl' },
439
+ { startIndex: 5, type: 'white.wgsl' },
440
+ { startIndex: 6, type: 'identifier.wgsl' },
441
+ { startIndex: 8, type: 'white.wgsl' },
442
+ { startIndex: 9, type: 'operator.wgsl' },
443
+ { startIndex: 10, type: 'white.wgsl' },
444
+ { startIndex: 11, type: 'number.hex.wgsl' },
445
+ { startIndex: 19, type: 'delimiter.wgsl' }
446
+ ]
447
+ },
448
+ {
449
+ line: 'const du = 0x12345u;',
450
+ tokens: [
451
+ { startIndex: 0, type: 'keyword.wgsl' },
452
+ { startIndex: 5, type: 'white.wgsl' },
453
+ { startIndex: 6, type: 'identifier.wgsl' },
454
+ { startIndex: 8, type: 'white.wgsl' },
455
+ { startIndex: 9, type: 'operator.wgsl' },
456
+ { startIndex: 10, type: 'white.wgsl' },
457
+ { startIndex: 11, type: 'number.hex.wgsl' },
458
+ { startIndex: 19, type: 'delimiter.wgsl' }
459
+ ]
460
+ },
461
+ {
462
+ line: 'const eh = 0h;',
463
+ tokens: [
464
+ { startIndex: 0, type: 'keyword.wgsl' },
465
+ { startIndex: 5, type: 'white.wgsl' },
466
+ { startIndex: 6, type: 'identifier.wgsl' },
467
+ { startIndex: 8, type: 'white.wgsl' },
468
+ { startIndex: 9, type: 'operator.wgsl' },
469
+ { startIndex: 10, type: 'white.wgsl' },
470
+ { startIndex: 11, type: 'number.float.wgsl' },
471
+ { startIndex: 13, type: 'delimiter.wgsl' }
472
+ ]
473
+ },
474
+ {
475
+ line: 'const ef = 0f;',
476
+ tokens: [
477
+ { startIndex: 0, type: 'keyword.wgsl' },
478
+ { startIndex: 5, type: 'white.wgsl' },
479
+ { startIndex: 6, type: 'identifier.wgsl' },
480
+ { startIndex: 8, type: 'white.wgsl' },
481
+ { startIndex: 9, type: 'operator.wgsl' },
482
+ { startIndex: 10, type: 'white.wgsl' },
483
+ { startIndex: 11, type: 'number.float.wgsl' },
484
+ { startIndex: 13, type: 'delimiter.wgsl' }
485
+ ]
486
+ },
487
+ {
488
+ line: 'const f = 1.;',
489
+ tokens: [
490
+ { startIndex: 0, type: 'keyword.wgsl' },
491
+ { startIndex: 5, type: 'white.wgsl' },
492
+ { startIndex: 6, type: 'identifier.wgsl' },
493
+ { startIndex: 7, type: 'white.wgsl' },
494
+ { startIndex: 8, type: 'operator.wgsl' },
495
+ { startIndex: 9, type: 'white.wgsl' },
496
+ { startIndex: 10, type: 'number.float.wgsl' },
497
+ { startIndex: 12, type: 'delimiter.wgsl' }
498
+ ]
499
+ },
500
+ {
501
+ line: 'const fh = 1.h;',
502
+ tokens: [
503
+ { startIndex: 0, type: 'keyword.wgsl' },
504
+ { startIndex: 5, type: 'white.wgsl' },
505
+ { startIndex: 6, type: 'identifier.wgsl' },
506
+ { startIndex: 8, type: 'white.wgsl' },
507
+ { startIndex: 9, type: 'operator.wgsl' },
508
+ { startIndex: 10, type: 'white.wgsl' },
509
+ { startIndex: 11, type: 'number.float.wgsl' },
510
+ { startIndex: 14, type: 'delimiter.wgsl' }
511
+ ]
512
+ },
513
+ {
514
+ line: 'const ff = 1.f;',
515
+ tokens: [
516
+ { startIndex: 0, type: 'keyword.wgsl' },
517
+ { startIndex: 5, type: 'white.wgsl' },
518
+ { startIndex: 6, type: 'identifier.wgsl' },
519
+ { startIndex: 8, type: 'white.wgsl' },
520
+ { startIndex: 9, type: 'operator.wgsl' },
521
+ { startIndex: 10, type: 'white.wgsl' },
522
+ { startIndex: 11, type: 'number.float.wgsl' },
523
+ { startIndex: 14, type: 'delimiter.wgsl' }
524
+ ]
525
+ },
526
+ {
527
+ line: 'const g = .1;',
528
+ tokens: [
529
+ { startIndex: 0, type: 'keyword.wgsl' },
530
+ { startIndex: 5, type: 'white.wgsl' },
531
+ { startIndex: 6, type: 'identifier.wgsl' },
532
+ { startIndex: 7, type: 'white.wgsl' },
533
+ { startIndex: 8, type: 'operator.wgsl' },
534
+ { startIndex: 9, type: 'white.wgsl' },
535
+ { startIndex: 10, type: 'number.float.wgsl' },
536
+ { startIndex: 12, type: 'delimiter.wgsl' }
537
+ ]
538
+ },
539
+ {
540
+ line: 'const gh = .1h;',
541
+ tokens: [
542
+ { startIndex: 0, type: 'keyword.wgsl' },
543
+ { startIndex: 5, type: 'white.wgsl' },
544
+ { startIndex: 6, type: 'identifier.wgsl' },
545
+ { startIndex: 8, type: 'white.wgsl' },
546
+ { startIndex: 9, type: 'operator.wgsl' },
547
+ { startIndex: 10, type: 'white.wgsl' },
548
+ { startIndex: 11, type: 'number.float.wgsl' },
549
+ { startIndex: 14, type: 'delimiter.wgsl' }
550
+ ]
551
+ },
552
+ {
553
+ line: 'const gf = .1f;',
554
+ tokens: [
555
+ { startIndex: 0, type: 'keyword.wgsl' },
556
+ { startIndex: 5, type: 'white.wgsl' },
557
+ { startIndex: 6, type: 'identifier.wgsl' },
558
+ { startIndex: 8, type: 'white.wgsl' },
559
+ { startIndex: 9, type: 'operator.wgsl' },
560
+ { startIndex: 10, type: 'white.wgsl' },
561
+ { startIndex: 11, type: 'number.float.wgsl' },
562
+ { startIndex: 14, type: 'delimiter.wgsl' }
563
+ ]
564
+ },
565
+ {
566
+ line: 'const g = 1e1;',
567
+ tokens: [
568
+ { startIndex: 0, type: 'keyword.wgsl' },
569
+ { startIndex: 5, type: 'white.wgsl' },
570
+ { startIndex: 6, type: 'identifier.wgsl' },
571
+ { startIndex: 7, type: 'white.wgsl' },
572
+ { startIndex: 8, type: 'operator.wgsl' },
573
+ { startIndex: 9, type: 'white.wgsl' },
574
+ { startIndex: 10, type: 'number.float.wgsl' },
575
+ { startIndex: 13, type: 'delimiter.wgsl' }
576
+ ]
577
+ },
578
+ {
579
+ line: 'const gh = 1e1h;',
580
+ tokens: [
581
+ { startIndex: 0, type: 'keyword.wgsl' },
582
+ { startIndex: 5, type: 'white.wgsl' },
583
+ { startIndex: 6, type: 'identifier.wgsl' },
584
+ { startIndex: 8, type: 'white.wgsl' },
585
+ { startIndex: 9, type: 'operator.wgsl' },
586
+ { startIndex: 10, type: 'white.wgsl' },
587
+ { startIndex: 11, type: 'number.float.wgsl' },
588
+ { startIndex: 15, type: 'delimiter.wgsl' }
589
+ ]
590
+ },
591
+ {
592
+ line: 'const gf = 1e1f;',
593
+ tokens: [
594
+ { startIndex: 0, type: 'keyword.wgsl' },
595
+ { startIndex: 5, type: 'white.wgsl' },
596
+ { startIndex: 6, type: 'identifier.wgsl' },
597
+ { startIndex: 8, type: 'white.wgsl' },
598
+ { startIndex: 9, type: 'operator.wgsl' },
599
+ { startIndex: 10, type: 'white.wgsl' },
600
+ { startIndex: 11, type: 'number.float.wgsl' },
601
+ { startIndex: 15, type: 'delimiter.wgsl' }
602
+ ]
603
+ },
604
+ {
605
+ line: 'const h = 1e+1;',
606
+ tokens: [
607
+ { startIndex: 0, type: 'keyword.wgsl' },
608
+ { startIndex: 5, type: 'white.wgsl' },
609
+ { startIndex: 6, type: 'identifier.wgsl' },
610
+ { startIndex: 7, type: 'white.wgsl' },
611
+ { startIndex: 8, type: 'operator.wgsl' },
612
+ { startIndex: 9, type: 'white.wgsl' },
613
+ { startIndex: 10, type: 'number.float.wgsl' },
614
+ { startIndex: 14, type: 'delimiter.wgsl' }
615
+ ]
616
+ },
617
+ {
618
+ line: 'const hh = 1e+1h;',
619
+ tokens: [
620
+ { startIndex: 0, type: 'keyword.wgsl' },
621
+ { startIndex: 5, type: 'white.wgsl' },
622
+ { startIndex: 6, type: 'identifier.wgsl' },
623
+ { startIndex: 8, type: 'white.wgsl' },
624
+ { startIndex: 9, type: 'operator.wgsl' },
625
+ { startIndex: 10, type: 'white.wgsl' },
626
+ { startIndex: 11, type: 'number.float.wgsl' },
627
+ { startIndex: 16, type: 'delimiter.wgsl' }
628
+ ]
629
+ },
630
+ {
631
+ line: 'const hf = 1e+1f;',
632
+ tokens: [
633
+ { startIndex: 0, type: 'keyword.wgsl' },
634
+ { startIndex: 5, type: 'white.wgsl' },
635
+ { startIndex: 6, type: 'identifier.wgsl' },
636
+ { startIndex: 8, type: 'white.wgsl' },
637
+ { startIndex: 9, type: 'operator.wgsl' },
638
+ { startIndex: 10, type: 'white.wgsl' },
639
+ { startIndex: 11, type: 'number.float.wgsl' },
640
+ { startIndex: 16, type: 'delimiter.wgsl' }
641
+ ]
642
+ },
643
+ {
644
+ line: 'const i = 1e-1;',
645
+ tokens: [
646
+ { startIndex: 0, type: 'keyword.wgsl' },
647
+ { startIndex: 5, type: 'white.wgsl' },
648
+ { startIndex: 6, type: 'identifier.wgsl' },
649
+ { startIndex: 7, type: 'white.wgsl' },
650
+ { startIndex: 8, type: 'operator.wgsl' },
651
+ { startIndex: 9, type: 'white.wgsl' },
652
+ { startIndex: 10, type: 'number.float.wgsl' },
653
+ { startIndex: 14, type: 'delimiter.wgsl' }
654
+ ]
655
+ },
656
+ {
657
+ line: 'const ih = 1e-1h;',
658
+ tokens: [
659
+ { startIndex: 0, type: 'keyword.wgsl' },
660
+ { startIndex: 5, type: 'white.wgsl' },
661
+ { startIndex: 6, type: 'identifier.wgsl' },
662
+ { startIndex: 8, type: 'white.wgsl' },
663
+ { startIndex: 9, type: 'operator.wgsl' },
664
+ { startIndex: 10, type: 'white.wgsl' },
665
+ { startIndex: 11, type: 'number.float.wgsl' },
666
+ { startIndex: 16, type: 'delimiter.wgsl' }
667
+ ]
668
+ },
669
+ {
670
+ line: 'const if = 1e-1f;',
671
+ tokens: [
672
+ { startIndex: 0, type: 'keyword.wgsl' },
673
+ { startIndex: 5, type: 'white.wgsl' },
674
+ { startIndex: 6, type: 'keyword.wgsl' },
675
+ { startIndex: 8, type: 'white.wgsl' },
676
+ { startIndex: 9, type: 'operator.wgsl' },
677
+ { startIndex: 10, type: 'white.wgsl' },
678
+ { startIndex: 11, type: 'number.float.wgsl' },
679
+ { startIndex: 16, type: 'delimiter.wgsl' }
680
+ ]
681
+ },
682
+ {
683
+ line: 'const j = 1.0e+1;',
684
+ tokens: [
685
+ { startIndex: 0, type: 'keyword.wgsl' },
686
+ { startIndex: 5, type: 'white.wgsl' },
687
+ { startIndex: 6, type: 'identifier.wgsl' },
688
+ { startIndex: 7, type: 'white.wgsl' },
689
+ { startIndex: 8, type: 'operator.wgsl' },
690
+ { startIndex: 9, type: 'white.wgsl' },
691
+ { startIndex: 10, type: 'number.float.wgsl' },
692
+ { startIndex: 16, type: 'delimiter.wgsl' }
693
+ ]
694
+ },
695
+ {
696
+ line: 'const jh = 1.0e+1h;',
697
+ tokens: [
698
+ { startIndex: 0, type: 'keyword.wgsl' },
699
+ { startIndex: 5, type: 'white.wgsl' },
700
+ { startIndex: 6, type: 'identifier.wgsl' },
701
+ { startIndex: 8, type: 'white.wgsl' },
702
+ { startIndex: 9, type: 'operator.wgsl' },
703
+ { startIndex: 10, type: 'white.wgsl' },
704
+ { startIndex: 11, type: 'number.float.wgsl' },
705
+ { startIndex: 18, type: 'delimiter.wgsl' }
706
+ ]
707
+ },
708
+ {
709
+ line: 'const jf= 1.0e+1f;',
710
+ tokens: [
711
+ { startIndex: 0, type: 'keyword.wgsl' },
712
+ { startIndex: 5, type: 'white.wgsl' },
713
+ { startIndex: 6, type: 'identifier.wgsl' },
714
+ { startIndex: 8, type: 'operator.wgsl' },
715
+ { startIndex: 9, type: 'white.wgsl' },
716
+ { startIndex: 10, type: 'number.float.wgsl' },
717
+ { startIndex: 17, type: 'delimiter.wgsl' }
718
+ ]
719
+ },
720
+ {
721
+ line: 'const k = 1.0e-1;',
722
+ tokens: [
723
+ { startIndex: 0, type: 'keyword.wgsl' },
724
+ { startIndex: 5, type: 'white.wgsl' },
725
+ { startIndex: 6, type: 'identifier.wgsl' },
726
+ { startIndex: 7, type: 'white.wgsl' },
727
+ { startIndex: 8, type: 'operator.wgsl' },
728
+ { startIndex: 9, type: 'white.wgsl' },
729
+ { startIndex: 10, type: 'number.float.wgsl' },
730
+ { startIndex: 16, type: 'delimiter.wgsl' }
731
+ ]
732
+ },
733
+ {
734
+ line: 'const kh = 1.0e-1h;',
735
+ tokens: [
736
+ { startIndex: 0, type: 'keyword.wgsl' },
737
+ { startIndex: 5, type: 'white.wgsl' },
738
+ { startIndex: 6, type: 'identifier.wgsl' },
739
+ { startIndex: 8, type: 'white.wgsl' },
740
+ { startIndex: 9, type: 'operator.wgsl' },
741
+ { startIndex: 10, type: 'white.wgsl' },
742
+ { startIndex: 11, type: 'number.float.wgsl' },
743
+ { startIndex: 18, type: 'delimiter.wgsl' }
744
+ ]
745
+ },
746
+ {
747
+ line: 'const kf= 1.0e-1f;',
748
+ tokens: [
749
+ { startIndex: 0, type: 'keyword.wgsl' },
750
+ { startIndex: 5, type: 'white.wgsl' },
751
+ { startIndex: 6, type: 'identifier.wgsl' },
752
+ { startIndex: 8, type: 'operator.wgsl' },
753
+ { startIndex: 9, type: 'white.wgsl' },
754
+ { startIndex: 10, type: 'number.float.wgsl' },
755
+ { startIndex: 17, type: 'delimiter.wgsl' }
756
+ ]
757
+ },
758
+ {
759
+ line: 'const l = 0x1p1;',
760
+ tokens: [
761
+ { startIndex: 0, type: 'keyword.wgsl' },
762
+ { startIndex: 5, type: 'white.wgsl' },
763
+ { startIndex: 6, type: 'identifier.wgsl' },
764
+ { startIndex: 7, type: 'white.wgsl' },
765
+ { startIndex: 8, type: 'operator.wgsl' },
766
+ { startIndex: 9, type: 'white.wgsl' },
767
+ { startIndex: 10, type: 'number.hex.wgsl' },
768
+ { startIndex: 15, type: 'delimiter.wgsl' }
769
+ ]
770
+ },
771
+ {
772
+ line: 'const lh = 0x1p1h;',
773
+ tokens: [
774
+ { startIndex: 0, type: 'keyword.wgsl' },
775
+ { startIndex: 5, type: 'white.wgsl' },
776
+ { startIndex: 6, type: 'identifier.wgsl' },
777
+ { startIndex: 8, type: 'white.wgsl' },
778
+ { startIndex: 9, type: 'operator.wgsl' },
779
+ { startIndex: 10, type: 'white.wgsl' },
780
+ { startIndex: 11, type: 'number.hex.wgsl' },
781
+ { startIndex: 17, type: 'delimiter.wgsl' }
782
+ ]
783
+ },
784
+ {
785
+ line: 'const lf = 0x1p1f;',
786
+ tokens: [
787
+ { startIndex: 0, type: 'keyword.wgsl' },
788
+ { startIndex: 5, type: 'white.wgsl' },
789
+ { startIndex: 6, type: 'identifier.wgsl' },
790
+ { startIndex: 8, type: 'white.wgsl' },
791
+ { startIndex: 9, type: 'operator.wgsl' },
792
+ { startIndex: 10, type: 'white.wgsl' },
793
+ { startIndex: 11, type: 'number.hex.wgsl' },
794
+ { startIndex: 17, type: 'delimiter.wgsl' }
795
+ ]
796
+ },
797
+ {
798
+ line: 'const m = 0x1p+1;',
799
+ tokens: [
800
+ { startIndex: 0, type: 'keyword.wgsl' },
801
+ { startIndex: 5, type: 'white.wgsl' },
802
+ { startIndex: 6, type: 'identifier.wgsl' },
803
+ { startIndex: 7, type: 'white.wgsl' },
804
+ { startIndex: 8, type: 'operator.wgsl' },
805
+ { startIndex: 9, type: 'white.wgsl' },
806
+ { startIndex: 10, type: 'number.hex.wgsl' },
807
+ { startIndex: 16, type: 'delimiter.wgsl' }
808
+ ]
809
+ },
810
+ {
811
+ line: 'const mh = 0x1p+1h;',
812
+ tokens: [
813
+ { startIndex: 0, type: 'keyword.wgsl' },
814
+ { startIndex: 5, type: 'white.wgsl' },
815
+ { startIndex: 6, type: 'identifier.wgsl' },
816
+ { startIndex: 8, type: 'white.wgsl' },
817
+ { startIndex: 9, type: 'operator.wgsl' },
818
+ { startIndex: 10, type: 'white.wgsl' },
819
+ { startIndex: 11, type: 'number.hex.wgsl' },
820
+ { startIndex: 18, type: 'delimiter.wgsl' }
821
+ ]
822
+ },
823
+ {
824
+ line: 'const mf = 0x1p+1f;',
825
+ tokens: [
826
+ { startIndex: 0, type: 'keyword.wgsl' },
827
+ { startIndex: 5, type: 'white.wgsl' },
828
+ { startIndex: 6, type: 'identifier.wgsl' },
829
+ { startIndex: 8, type: 'white.wgsl' },
830
+ { startIndex: 9, type: 'operator.wgsl' },
831
+ { startIndex: 10, type: 'white.wgsl' },
832
+ { startIndex: 11, type: 'number.hex.wgsl' },
833
+ { startIndex: 18, type: 'delimiter.wgsl' }
834
+ ]
835
+ },
836
+ {
837
+ line: 'const n = 0x1p-1;',
838
+ tokens: [
839
+ { startIndex: 0, type: 'keyword.wgsl' },
840
+ { startIndex: 5, type: 'white.wgsl' },
841
+ { startIndex: 6, type: 'identifier.wgsl' },
842
+ { startIndex: 7, type: 'white.wgsl' },
843
+ { startIndex: 8, type: 'operator.wgsl' },
844
+ { startIndex: 9, type: 'white.wgsl' },
845
+ { startIndex: 10, type: 'number.hex.wgsl' },
846
+ { startIndex: 16, type: 'delimiter.wgsl' }
847
+ ]
848
+ },
849
+ {
850
+ line: 'const nh = 0x1p-1h;',
851
+ tokens: [
852
+ { startIndex: 0, type: 'keyword.wgsl' },
853
+ { startIndex: 5, type: 'white.wgsl' },
854
+ { startIndex: 6, type: 'identifier.wgsl' },
855
+ { startIndex: 8, type: 'white.wgsl' },
856
+ { startIndex: 9, type: 'operator.wgsl' },
857
+ { startIndex: 10, type: 'white.wgsl' },
858
+ { startIndex: 11, type: 'number.hex.wgsl' },
859
+ { startIndex: 18, type: 'delimiter.wgsl' }
860
+ ]
861
+ },
862
+ {
863
+ line: 'const nf = 0x1p-1f;',
864
+ tokens: [
865
+ { startIndex: 0, type: 'keyword.wgsl' },
866
+ { startIndex: 5, type: 'white.wgsl' },
867
+ { startIndex: 6, type: 'identifier.wgsl' },
868
+ { startIndex: 8, type: 'white.wgsl' },
869
+ { startIndex: 9, type: 'operator.wgsl' },
870
+ { startIndex: 10, type: 'white.wgsl' },
871
+ { startIndex: 11, type: 'number.hex.wgsl' },
872
+ { startIndex: 18, type: 'delimiter.wgsl' }
873
+ ]
874
+ },
875
+ {
876
+ line: 'const oo = 0x1.p1;',
877
+ tokens: [
878
+ { startIndex: 0, type: 'keyword.wgsl' },
879
+ { startIndex: 5, type: 'white.wgsl' },
880
+ { startIndex: 6, type: 'identifier.wgsl' },
881
+ { startIndex: 8, type: 'white.wgsl' },
882
+ { startIndex: 9, type: 'operator.wgsl' },
883
+ { startIndex: 10, type: 'white.wgsl' },
884
+ { startIndex: 11, type: 'number.hex.wgsl' },
885
+ { startIndex: 17, type: 'delimiter.wgsl' }
886
+ ]
887
+ },
888
+ {
889
+ line: 'const ooh = 0x1.p1h;',
890
+ tokens: [
891
+ { startIndex: 0, type: 'keyword.wgsl' },
892
+ { startIndex: 5, type: 'white.wgsl' },
893
+ { startIndex: 6, type: 'identifier.wgsl' },
894
+ { startIndex: 9, type: 'white.wgsl' },
895
+ { startIndex: 10, type: 'operator.wgsl' },
896
+ { startIndex: 11, type: 'white.wgsl' },
897
+ { startIndex: 12, type: 'number.hex.wgsl' },
898
+ { startIndex: 19, type: 'delimiter.wgsl' }
899
+ ]
900
+ },
901
+ {
902
+ line: 'const oof = 0x1.p1f;',
903
+ tokens: [
904
+ { startIndex: 0, type: 'keyword.wgsl' },
905
+ { startIndex: 5, type: 'white.wgsl' },
906
+ { startIndex: 6, type: 'identifier.wgsl' },
907
+ { startIndex: 9, type: 'white.wgsl' },
908
+ { startIndex: 10, type: 'operator.wgsl' },
909
+ { startIndex: 11, type: 'white.wgsl' },
910
+ { startIndex: 12, type: 'number.hex.wgsl' },
911
+ { startIndex: 19, type: 'delimiter.wgsl' }
912
+ ]
913
+ },
914
+ {
915
+ line: 'const p = 0x.1p1;',
916
+ tokens: [
917
+ { startIndex: 0, type: 'keyword.wgsl' },
918
+ { startIndex: 5, type: 'white.wgsl' },
919
+ { startIndex: 6, type: 'identifier.wgsl' },
920
+ { startIndex: 7, type: 'white.wgsl' },
921
+ { startIndex: 8, type: 'operator.wgsl' },
922
+ { startIndex: 9, type: 'white.wgsl' },
923
+ { startIndex: 10, type: 'number.hex.wgsl' },
924
+ { startIndex: 16, type: 'delimiter.wgsl' }
925
+ ]
926
+ },
927
+ {
928
+ line: 'const ph = 0x.1p1h;',
929
+ tokens: [
930
+ { startIndex: 0, type: 'keyword.wgsl' },
931
+ { startIndex: 5, type: 'white.wgsl' },
932
+ { startIndex: 6, type: 'identifier.wgsl' },
933
+ { startIndex: 8, type: 'white.wgsl' },
934
+ { startIndex: 9, type: 'operator.wgsl' },
935
+ { startIndex: 10, type: 'white.wgsl' },
936
+ { startIndex: 11, type: 'number.hex.wgsl' },
937
+ { startIndex: 18, type: 'delimiter.wgsl' }
938
+ ]
939
+ },
940
+ {
941
+ line: 'const pf = 0x.1p1f;',
942
+ tokens: [
943
+ { startIndex: 0, type: 'keyword.wgsl' },
944
+ { startIndex: 5, type: 'white.wgsl' },
945
+ { startIndex: 6, type: 'identifier.wgsl' },
946
+ { startIndex: 8, type: 'white.wgsl' },
947
+ { startIndex: 9, type: 'operator.wgsl' },
948
+ { startIndex: 10, type: 'white.wgsl' },
949
+ { startIndex: 11, type: 'number.hex.wgsl' },
950
+ { startIndex: 18, type: 'delimiter.wgsl' }
951
+ ]
952
+ }
953
+ ],
954
+ // depth texture
955
+ [
956
+ {
957
+ line: '@group(0) @binding(1) var texture_depth_2d;',
958
+ tokens: [
959
+ { startIndex: 0, type: 'annotation.wgsl' },
960
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
961
+ { startIndex: 7, type: 'number.wgsl' },
962
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
963
+ { startIndex: 9, type: 'white.wgsl' },
964
+ { startIndex: 10, type: 'annotation.wgsl' },
965
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
966
+ { startIndex: 19, type: 'number.wgsl' },
967
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
968
+ { startIndex: 21, type: 'white.wgsl' },
969
+ { startIndex: 22, type: 'keyword.wgsl' },
970
+ { startIndex: 25, type: 'white.wgsl' },
971
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
972
+ { startIndex: 42, type: 'delimiter.wgsl' }
973
+ ]
974
+ },
975
+ {
976
+ line: '@group(0) @binding(2) var texture_depth_2d_array;',
977
+ tokens: [
978
+ { startIndex: 0, type: 'annotation.wgsl' },
979
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
980
+ { startIndex: 7, type: 'number.wgsl' },
981
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
982
+ { startIndex: 9, type: 'white.wgsl' },
983
+ { startIndex: 10, type: 'annotation.wgsl' },
984
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
985
+ { startIndex: 19, type: 'number.wgsl' },
986
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
987
+ { startIndex: 21, type: 'white.wgsl' },
988
+ { startIndex: 22, type: 'keyword.wgsl' },
989
+ { startIndex: 25, type: 'white.wgsl' },
990
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
991
+ { startIndex: 48, type: 'delimiter.wgsl' }
992
+ ]
993
+ },
994
+ {
995
+ line: '@group(0) @binding(4) var texture_depth_cube;',
996
+ tokens: [
997
+ { startIndex: 0, type: 'annotation.wgsl' },
998
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
999
+ { startIndex: 7, type: 'number.wgsl' },
1000
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
1001
+ { startIndex: 9, type: 'white.wgsl' },
1002
+ { startIndex: 10, type: 'annotation.wgsl' },
1003
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
1004
+ { startIndex: 19, type: 'number.wgsl' },
1005
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
1006
+ { startIndex: 21, type: 'white.wgsl' },
1007
+ { startIndex: 22, type: 'keyword.wgsl' },
1008
+ { startIndex: 25, type: 'white.wgsl' },
1009
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
1010
+ { startIndex: 44, type: 'delimiter.wgsl' }
1011
+ ]
1012
+ },
1013
+ {
1014
+ line: '@group(0) @binding(5) var texture_depth_cube_array;',
1015
+ tokens: [
1016
+ { startIndex: 0, type: 'annotation.wgsl' },
1017
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
1018
+ { startIndex: 7, type: 'number.wgsl' },
1019
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
1020
+ { startIndex: 9, type: 'white.wgsl' },
1021
+ { startIndex: 10, type: 'annotation.wgsl' },
1022
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
1023
+ { startIndex: 19, type: 'number.wgsl' },
1024
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
1025
+ { startIndex: 21, type: 'white.wgsl' },
1026
+ { startIndex: 22, type: 'keyword.wgsl' },
1027
+ { startIndex: 25, type: 'white.wgsl' },
1028
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
1029
+ { startIndex: 50, type: 'delimiter.wgsl' }
1030
+ ]
1031
+ },
1032
+ {
1033
+ line: '@group(0) @binding(5) var texture_depth_multisampled_2d;',
1034
+ tokens: [
1035
+ { startIndex: 0, type: 'annotation.wgsl' },
1036
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
1037
+ { startIndex: 7, type: 'number.wgsl' },
1038
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
1039
+ { startIndex: 9, type: 'white.wgsl' },
1040
+ { startIndex: 10, type: 'annotation.wgsl' },
1041
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
1042
+ { startIndex: 19, type: 'number.wgsl' },
1043
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
1044
+ { startIndex: 21, type: 'white.wgsl' },
1045
+ { startIndex: 22, type: 'keyword.wgsl' },
1046
+ { startIndex: 25, type: 'white.wgsl' },
1047
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
1048
+ { startIndex: 55, type: 'delimiter.wgsl' }
1049
+ ]
1050
+ }
1051
+ ],
1052
+ // directive
1053
+ [
1054
+ {
1055
+ line: 'enable f16;',
1056
+ tokens: [
1057
+ { startIndex: 0, type: 'keyword.wgsl' },
1058
+ { startIndex: 6, type: 'white.wgsl' },
1059
+ { startIndex: 7, type: 'meta.content.wgsl' },
1060
+ { startIndex: 10, type: 'delimiter.wgsl' }
1061
+ ]
1062
+ },
1063
+ {
1064
+ line: 'requires v1;',
1065
+ tokens: [
1066
+ { startIndex: 0, type: 'keyword.wgsl' },
1067
+ { startIndex: 8, type: 'white.wgsl' },
1068
+ { startIndex: 9, type: 'meta.content.wgsl' },
1069
+ { startIndex: 11, type: 'delimiter.wgsl' }
1070
+ ]
1071
+ },
1072
+ {
1073
+ line: 'diagnostic(error,derivative_uniformity);',
1074
+ tokens: [
1075
+ { startIndex: 0, type: 'keyword.wgsl' },
1076
+ { startIndex: 10, type: 'delimiter.parenthesis.wgsl' },
1077
+ { startIndex: 11, type: 'meta.content.wgsl' },
1078
+ { startIndex: 16, type: 'delimiter.wgsl' },
1079
+ { startIndex: 17, type: 'meta.content.wgsl' },
1080
+ { startIndex: 38, type: 'delimiter.parenthesis.wgsl' },
1081
+ { startIndex: 39, type: 'delimiter.wgsl' }
1082
+ ]
1083
+ },
1084
+ {
1085
+ line: 'diagnostic(warning,derivative_uniformity);',
1086
+ tokens: [
1087
+ { startIndex: 0, type: 'keyword.wgsl' },
1088
+ { startIndex: 10, type: 'delimiter.parenthesis.wgsl' },
1089
+ { startIndex: 11, type: 'meta.content.wgsl' },
1090
+ { startIndex: 18, type: 'delimiter.wgsl' },
1091
+ { startIndex: 19, type: 'meta.content.wgsl' },
1092
+ { startIndex: 40, type: 'delimiter.parenthesis.wgsl' },
1093
+ { startIndex: 41, type: 'delimiter.wgsl' }
1094
+ ]
1095
+ },
1096
+ {
1097
+ line: 'diagnostic(off,derivative_uniformity);',
1098
+ tokens: [
1099
+ { startIndex: 0, type: 'keyword.wgsl' },
1100
+ { startIndex: 10, type: 'delimiter.parenthesis.wgsl' },
1101
+ { startIndex: 11, type: 'meta.content.wgsl' },
1102
+ { startIndex: 14, type: 'delimiter.wgsl' },
1103
+ { startIndex: 15, type: 'meta.content.wgsl' },
1104
+ { startIndex: 36, type: 'delimiter.parenthesis.wgsl' },
1105
+ { startIndex: 37, type: 'delimiter.wgsl' }
1106
+ ]
1107
+ },
1108
+ {
1109
+ line: 'diagnostic(info,derivative_uniformity);',
1110
+ tokens: [
1111
+ { startIndex: 0, type: 'keyword.wgsl' },
1112
+ { startIndex: 10, type: 'delimiter.parenthesis.wgsl' },
1113
+ { startIndex: 11, type: 'meta.content.wgsl' },
1114
+ { startIndex: 15, type: 'delimiter.wgsl' },
1115
+ { startIndex: 16, type: 'meta.content.wgsl' },
1116
+ { startIndex: 37, type: 'delimiter.parenthesis.wgsl' },
1117
+ { startIndex: 38, type: 'delimiter.wgsl' }
1118
+ ]
1119
+ },
1120
+ { line: '', tokens: [] },
1121
+ {
1122
+ line: '@diagnostic(off,derviative_uniformity) fn main() {}',
1123
+ tokens: [
1124
+ { startIndex: 0, type: 'annotation.wgsl' },
1125
+ { startIndex: 11, type: 'delimiter.parenthesis.wgsl' },
1126
+ { startIndex: 12, type: 'identifier.wgsl' },
1127
+ { startIndex: 15, type: 'delimiter.wgsl' },
1128
+ { startIndex: 16, type: 'identifier.wgsl' },
1129
+ { startIndex: 37, type: 'delimiter.parenthesis.wgsl' },
1130
+ { startIndex: 38, type: 'white.wgsl' },
1131
+ { startIndex: 39, type: 'keyword.wgsl' },
1132
+ { startIndex: 41, type: 'white.wgsl' },
1133
+ { startIndex: 42, type: 'identifier.wgsl' },
1134
+ { startIndex: 46, type: 'delimiter.parenthesis.wgsl' },
1135
+ { startIndex: 48, type: 'white.wgsl' },
1136
+ { startIndex: 49, type: 'delimiter.curly.wgsl' }
1137
+ ]
1138
+ }
1139
+ ],
1140
+ // external texture
1141
+ [
1142
+ {
1143
+ line: '@group(0) @binding(5) var texture_external;',
1144
+ tokens: [
1145
+ { startIndex: 0, type: 'annotation.wgsl' },
1146
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
1147
+ { startIndex: 7, type: 'number.wgsl' },
1148
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
1149
+ { startIndex: 9, type: 'white.wgsl' },
1150
+ { startIndex: 10, type: 'annotation.wgsl' },
1151
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
1152
+ { startIndex: 19, type: 'number.wgsl' },
1153
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
1154
+ { startIndex: 21, type: 'white.wgsl' },
1155
+ { startIndex: 22, type: 'keyword.wgsl' },
1156
+ { startIndex: 25, type: 'white.wgsl' },
1157
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
1158
+ { startIndex: 42, type: 'delimiter.wgsl' }
1159
+ ]
1160
+ }
1161
+ ],
1162
+ // keywords
1163
+ [
1164
+ { line: 'alias', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1165
+ { line: 'break', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1166
+ { line: 'case', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1167
+ { line: 'const', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1168
+ { line: 'const_assert', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1169
+ { line: 'continue', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1170
+ { line: 'continuing', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1171
+ { line: 'default', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1172
+ { line: 'diagnostic', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] },
1173
+ { line: 'discard', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1174
+ { line: 'else', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1175
+ { line: 'enable', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1176
+ { line: 'false', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1177
+ { line: 'fn', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1178
+ { line: 'for', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1179
+ { line: 'if', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1180
+ { line: 'let', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1181
+ { line: 'loop', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1182
+ { line: 'override', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1183
+ { line: 'requires', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1184
+ { line: 'return', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1185
+ { line: 'struct', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1186
+ { line: 'switch', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1187
+ { line: 'true', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1188
+ { line: 'var', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] },
1189
+ { line: 'while', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }
1190
+ ],
1191
+ // line comment
1192
+ [
1193
+ {
1194
+ line: ' // this is a line-ending comment',
1195
+ tokens: [
1196
+ { startIndex: 0, type: 'white.wgsl' },
1197
+ { startIndex: 2, type: 'comment.wgsl' }
1198
+ ]
1199
+ },
1200
+ {
1201
+ line: ' //* embed a bock comment start, after a space',
1202
+ tokens: [
1203
+ { startIndex: 0, type: 'white.wgsl' },
1204
+ { startIndex: 1, type: 'comment.wgsl' }
1205
+ ]
1206
+ },
1207
+ {
1208
+ line: '// /* embed a bock comment start, v2',
1209
+ tokens: [{ startIndex: 0, type: 'comment.wgsl' }]
1210
+ }
1211
+ ],
1212
+ // multisampled texture
1213
+ [
1214
+ {
1215
+ line: '@group(0) @binding(5) var texture_multisampled_2d<f32>;',
1216
+ tokens: [
1217
+ { startIndex: 0, type: 'annotation.wgsl' },
1218
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
1219
+ { startIndex: 7, type: 'number.wgsl' },
1220
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
1221
+ { startIndex: 9, type: 'white.wgsl' },
1222
+ { startIndex: 10, type: 'annotation.wgsl' },
1223
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
1224
+ { startIndex: 19, type: 'number.wgsl' },
1225
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
1226
+ { startIndex: 21, type: 'white.wgsl' },
1227
+ { startIndex: 22, type: 'keyword.wgsl' },
1228
+ { startIndex: 25, type: 'white.wgsl' },
1229
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
1230
+ { startIndex: 49, type: 'operator.wgsl' },
1231
+ { startIndex: 50, type: 'variable.predefined.wgsl' },
1232
+ { startIndex: 53, type: 'delimiter.wgsl' }
1233
+ ]
1234
+ }
1235
+ ],
1236
+ // numeric types
1237
+ [
1238
+ {
1239
+ line: 'enable f16;',
1240
+ tokens: [
1241
+ { startIndex: 0, type: 'keyword.wgsl' },
1242
+ { startIndex: 6, type: 'white.wgsl' },
1243
+ { startIndex: 7, type: 'meta.content.wgsl' },
1244
+ { startIndex: 10, type: 'delimiter.wgsl' }
1245
+ ]
1246
+ },
1247
+ {
1248
+ line: 'alias int=i32;',
1249
+ tokens: [
1250
+ { startIndex: 0, type: 'keyword.wgsl' },
1251
+ { startIndex: 5, type: 'white.wgsl' },
1252
+ { startIndex: 6, type: 'identifier.wgsl' },
1253
+ { startIndex: 9, type: 'operator.wgsl' },
1254
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1255
+ { startIndex: 13, type: 'delimiter.wgsl' }
1256
+ ]
1257
+ },
1258
+ {
1259
+ line: 'alias uint=u32;',
1260
+ tokens: [
1261
+ { startIndex: 0, type: 'keyword.wgsl' },
1262
+ { startIndex: 5, type: 'white.wgsl' },
1263
+ { startIndex: 6, type: 'identifier.wgsl' },
1264
+ { startIndex: 10, type: 'operator.wgsl' },
1265
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1266
+ { startIndex: 14, type: 'delimiter.wgsl' }
1267
+ ]
1268
+ },
1269
+ {
1270
+ line: 'alias float=f32;',
1271
+ tokens: [
1272
+ { startIndex: 0, type: 'keyword.wgsl' },
1273
+ { startIndex: 5, type: 'white.wgsl' },
1274
+ { startIndex: 6, type: 'identifier.wgsl' },
1275
+ { startIndex: 11, type: 'operator.wgsl' },
1276
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1277
+ { startIndex: 15, type: 'delimiter.wgsl' }
1278
+ ]
1279
+ },
1280
+ {
1281
+ line: 'alias half=f16;',
1282
+ tokens: [
1283
+ { startIndex: 0, type: 'keyword.wgsl' },
1284
+ { startIndex: 5, type: 'white.wgsl' },
1285
+ { startIndex: 6, type: 'identifier.wgsl' },
1286
+ { startIndex: 10, type: 'operator.wgsl' },
1287
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1288
+ { startIndex: 14, type: 'delimiter.wgsl' }
1289
+ ]
1290
+ },
1291
+ {
1292
+ line: 'alias ivec2=vec2i;',
1293
+ tokens: [
1294
+ { startIndex: 0, type: 'keyword.wgsl' },
1295
+ { startIndex: 5, type: 'white.wgsl' },
1296
+ { startIndex: 6, type: 'identifier.wgsl' },
1297
+ { startIndex: 11, type: 'operator.wgsl' },
1298
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1299
+ { startIndex: 17, type: 'delimiter.wgsl' }
1300
+ ]
1301
+ },
1302
+ {
1303
+ line: 'alias uvec2=vec2u;',
1304
+ tokens: [
1305
+ { startIndex: 0, type: 'keyword.wgsl' },
1306
+ { startIndex: 5, type: 'white.wgsl' },
1307
+ { startIndex: 6, type: 'identifier.wgsl' },
1308
+ { startIndex: 11, type: 'operator.wgsl' },
1309
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1310
+ { startIndex: 17, type: 'delimiter.wgsl' }
1311
+ ]
1312
+ },
1313
+ {
1314
+ line: 'alias vec2=vec2f;',
1315
+ tokens: [
1316
+ { startIndex: 0, type: 'keyword.wgsl' },
1317
+ { startIndex: 5, type: 'white.wgsl' },
1318
+ { startIndex: 6, type: 'variable.predefined.wgsl' },
1319
+ { startIndex: 10, type: 'operator.wgsl' },
1320
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1321
+ { startIndex: 16, type: 'delimiter.wgsl' }
1322
+ ]
1323
+ },
1324
+ {
1325
+ line: 'alias ivec3=vec3i;',
1326
+ tokens: [
1327
+ { startIndex: 0, type: 'keyword.wgsl' },
1328
+ { startIndex: 5, type: 'white.wgsl' },
1329
+ { startIndex: 6, type: 'identifier.wgsl' },
1330
+ { startIndex: 11, type: 'operator.wgsl' },
1331
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1332
+ { startIndex: 17, type: 'delimiter.wgsl' }
1333
+ ]
1334
+ },
1335
+ {
1336
+ line: 'alias uvec3=vec3u;',
1337
+ tokens: [
1338
+ { startIndex: 0, type: 'keyword.wgsl' },
1339
+ { startIndex: 5, type: 'white.wgsl' },
1340
+ { startIndex: 6, type: 'identifier.wgsl' },
1341
+ { startIndex: 11, type: 'operator.wgsl' },
1342
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1343
+ { startIndex: 17, type: 'delimiter.wgsl' }
1344
+ ]
1345
+ },
1346
+ {
1347
+ line: 'alias vec3=vec3f;',
1348
+ tokens: [
1349
+ { startIndex: 0, type: 'keyword.wgsl' },
1350
+ { startIndex: 5, type: 'white.wgsl' },
1351
+ { startIndex: 6, type: 'variable.predefined.wgsl' },
1352
+ { startIndex: 10, type: 'operator.wgsl' },
1353
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1354
+ { startIndex: 16, type: 'delimiter.wgsl' }
1355
+ ]
1356
+ },
1357
+ {
1358
+ line: 'alias ivec4=vec4i;',
1359
+ tokens: [
1360
+ { startIndex: 0, type: 'keyword.wgsl' },
1361
+ { startIndex: 5, type: 'white.wgsl' },
1362
+ { startIndex: 6, type: 'identifier.wgsl' },
1363
+ { startIndex: 11, type: 'operator.wgsl' },
1364
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1365
+ { startIndex: 17, type: 'delimiter.wgsl' }
1366
+ ]
1367
+ },
1368
+ {
1369
+ line: 'alias uvec4=vec4u;',
1370
+ tokens: [
1371
+ { startIndex: 0, type: 'keyword.wgsl' },
1372
+ { startIndex: 5, type: 'white.wgsl' },
1373
+ { startIndex: 6, type: 'identifier.wgsl' },
1374
+ { startIndex: 11, type: 'operator.wgsl' },
1375
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1376
+ { startIndex: 17, type: 'delimiter.wgsl' }
1377
+ ]
1378
+ },
1379
+ {
1380
+ line: 'alias ivec2_=vec2<i32>;',
1381
+ tokens: [
1382
+ { startIndex: 0, type: 'keyword.wgsl' },
1383
+ { startIndex: 5, type: 'white.wgsl' },
1384
+ { startIndex: 6, type: 'identifier.wgsl' },
1385
+ { startIndex: 12, type: 'operator.wgsl' },
1386
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
1387
+ { startIndex: 17, type: 'operator.wgsl' },
1388
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1389
+ { startIndex: 21, type: 'delimiter.wgsl' }
1390
+ ]
1391
+ },
1392
+ {
1393
+ line: 'alias uvec2_=vec2<u32>;',
1394
+ tokens: [
1395
+ { startIndex: 0, type: 'keyword.wgsl' },
1396
+ { startIndex: 5, type: 'white.wgsl' },
1397
+ { startIndex: 6, type: 'identifier.wgsl' },
1398
+ { startIndex: 12, type: 'operator.wgsl' },
1399
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
1400
+ { startIndex: 17, type: 'operator.wgsl' },
1401
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1402
+ { startIndex: 21, type: 'delimiter.wgsl' }
1403
+ ]
1404
+ },
1405
+ {
1406
+ line: 'alias vec2_=vec2<f32>;',
1407
+ tokens: [
1408
+ { startIndex: 0, type: 'keyword.wgsl' },
1409
+ { startIndex: 5, type: 'white.wgsl' },
1410
+ { startIndex: 6, type: 'identifier.wgsl' },
1411
+ { startIndex: 11, type: 'operator.wgsl' },
1412
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1413
+ { startIndex: 16, type: 'operator.wgsl' },
1414
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
1415
+ { startIndex: 20, type: 'delimiter.wgsl' }
1416
+ ]
1417
+ },
1418
+ {
1419
+ line: 'alias ivec3_=vec3<i32>;',
1420
+ tokens: [
1421
+ { startIndex: 0, type: 'keyword.wgsl' },
1422
+ { startIndex: 5, type: 'white.wgsl' },
1423
+ { startIndex: 6, type: 'identifier.wgsl' },
1424
+ { startIndex: 12, type: 'operator.wgsl' },
1425
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
1426
+ { startIndex: 17, type: 'operator.wgsl' },
1427
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1428
+ { startIndex: 21, type: 'delimiter.wgsl' }
1429
+ ]
1430
+ },
1431
+ {
1432
+ line: 'alias uvec3_=vec3<u32>;',
1433
+ tokens: [
1434
+ { startIndex: 0, type: 'keyword.wgsl' },
1435
+ { startIndex: 5, type: 'white.wgsl' },
1436
+ { startIndex: 6, type: 'identifier.wgsl' },
1437
+ { startIndex: 12, type: 'operator.wgsl' },
1438
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
1439
+ { startIndex: 17, type: 'operator.wgsl' },
1440
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1441
+ { startIndex: 21, type: 'delimiter.wgsl' }
1442
+ ]
1443
+ },
1444
+ {
1445
+ line: 'alias vec3_=vec3<f32>;',
1446
+ tokens: [
1447
+ { startIndex: 0, type: 'keyword.wgsl' },
1448
+ { startIndex: 5, type: 'white.wgsl' },
1449
+ { startIndex: 6, type: 'identifier.wgsl' },
1450
+ { startIndex: 11, type: 'operator.wgsl' },
1451
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1452
+ { startIndex: 16, type: 'operator.wgsl' },
1453
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
1454
+ { startIndex: 20, type: 'delimiter.wgsl' }
1455
+ ]
1456
+ },
1457
+ {
1458
+ line: 'alias ivec4_=vec4<i32>;',
1459
+ tokens: [
1460
+ { startIndex: 0, type: 'keyword.wgsl' },
1461
+ { startIndex: 5, type: 'white.wgsl' },
1462
+ { startIndex: 6, type: 'identifier.wgsl' },
1463
+ { startIndex: 12, type: 'operator.wgsl' },
1464
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
1465
+ { startIndex: 17, type: 'operator.wgsl' },
1466
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1467
+ { startIndex: 21, type: 'delimiter.wgsl' }
1468
+ ]
1469
+ },
1470
+ {
1471
+ line: 'alias uvec4_=vec4<u32>;',
1472
+ tokens: [
1473
+ { startIndex: 0, type: 'keyword.wgsl' },
1474
+ { startIndex: 5, type: 'white.wgsl' },
1475
+ { startIndex: 6, type: 'identifier.wgsl' },
1476
+ { startIndex: 12, type: 'operator.wgsl' },
1477
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
1478
+ { startIndex: 17, type: 'operator.wgsl' },
1479
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1480
+ { startIndex: 21, type: 'delimiter.wgsl' }
1481
+ ]
1482
+ },
1483
+ {
1484
+ line: 'alias vec4_=vec4<f32>;',
1485
+ tokens: [
1486
+ { startIndex: 0, type: 'keyword.wgsl' },
1487
+ { startIndex: 5, type: 'white.wgsl' },
1488
+ { startIndex: 6, type: 'identifier.wgsl' },
1489
+ { startIndex: 11, type: 'operator.wgsl' },
1490
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1491
+ { startIndex: 16, type: 'operator.wgsl' },
1492
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
1493
+ { startIndex: 20, type: 'delimiter.wgsl' }
1494
+ ]
1495
+ },
1496
+ {
1497
+ line: 'alias hvec2=vec2h;',
1498
+ tokens: [
1499
+ { startIndex: 0, type: 'keyword.wgsl' },
1500
+ { startIndex: 5, type: 'white.wgsl' },
1501
+ { startIndex: 6, type: 'identifier.wgsl' },
1502
+ { startIndex: 11, type: 'operator.wgsl' },
1503
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1504
+ { startIndex: 17, type: 'delimiter.wgsl' }
1505
+ ]
1506
+ },
1507
+ {
1508
+ line: 'alias hvec3=vec3h;',
1509
+ tokens: [
1510
+ { startIndex: 0, type: 'keyword.wgsl' },
1511
+ { startIndex: 5, type: 'white.wgsl' },
1512
+ { startIndex: 6, type: 'identifier.wgsl' },
1513
+ { startIndex: 11, type: 'operator.wgsl' },
1514
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1515
+ { startIndex: 17, type: 'delimiter.wgsl' }
1516
+ ]
1517
+ },
1518
+ {
1519
+ line: 'alias hvec4=vec4h;',
1520
+ tokens: [
1521
+ { startIndex: 0, type: 'keyword.wgsl' },
1522
+ { startIndex: 5, type: 'white.wgsl' },
1523
+ { startIndex: 6, type: 'identifier.wgsl' },
1524
+ { startIndex: 11, type: 'operator.wgsl' },
1525
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
1526
+ { startIndex: 17, type: 'delimiter.wgsl' }
1527
+ ]
1528
+ },
1529
+ {
1530
+ line: 'alias hvec4_=vec4<f16>;',
1531
+ tokens: [
1532
+ { startIndex: 0, type: 'keyword.wgsl' },
1533
+ { startIndex: 5, type: 'white.wgsl' },
1534
+ { startIndex: 6, type: 'identifier.wgsl' },
1535
+ { startIndex: 12, type: 'operator.wgsl' },
1536
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
1537
+ { startIndex: 17, type: 'operator.wgsl' },
1538
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1539
+ { startIndex: 21, type: 'delimiter.wgsl' }
1540
+ ]
1541
+ },
1542
+ {
1543
+ line: 'alias m22=mat2x2f;',
1544
+ tokens: [
1545
+ { startIndex: 0, type: 'keyword.wgsl' },
1546
+ { startIndex: 5, type: 'white.wgsl' },
1547
+ { startIndex: 6, type: 'identifier.wgsl' },
1548
+ { startIndex: 9, type: 'operator.wgsl' },
1549
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1550
+ { startIndex: 17, type: 'delimiter.wgsl' }
1551
+ ]
1552
+ },
1553
+ {
1554
+ line: 'alias m23=mat2x3f;',
1555
+ tokens: [
1556
+ { startIndex: 0, type: 'keyword.wgsl' },
1557
+ { startIndex: 5, type: 'white.wgsl' },
1558
+ { startIndex: 6, type: 'identifier.wgsl' },
1559
+ { startIndex: 9, type: 'operator.wgsl' },
1560
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1561
+ { startIndex: 17, type: 'delimiter.wgsl' }
1562
+ ]
1563
+ },
1564
+ {
1565
+ line: 'alias m24=mat2x4f;',
1566
+ tokens: [
1567
+ { startIndex: 0, type: 'keyword.wgsl' },
1568
+ { startIndex: 5, type: 'white.wgsl' },
1569
+ { startIndex: 6, type: 'identifier.wgsl' },
1570
+ { startIndex: 9, type: 'operator.wgsl' },
1571
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1572
+ { startIndex: 17, type: 'delimiter.wgsl' }
1573
+ ]
1574
+ },
1575
+ {
1576
+ line: 'alias m32=mat3x2f;',
1577
+ tokens: [
1578
+ { startIndex: 0, type: 'keyword.wgsl' },
1579
+ { startIndex: 5, type: 'white.wgsl' },
1580
+ { startIndex: 6, type: 'identifier.wgsl' },
1581
+ { startIndex: 9, type: 'operator.wgsl' },
1582
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1583
+ { startIndex: 17, type: 'delimiter.wgsl' }
1584
+ ]
1585
+ },
1586
+ {
1587
+ line: 'alias m33=mat3x3f;',
1588
+ tokens: [
1589
+ { startIndex: 0, type: 'keyword.wgsl' },
1590
+ { startIndex: 5, type: 'white.wgsl' },
1591
+ { startIndex: 6, type: 'identifier.wgsl' },
1592
+ { startIndex: 9, type: 'operator.wgsl' },
1593
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1594
+ { startIndex: 17, type: 'delimiter.wgsl' }
1595
+ ]
1596
+ },
1597
+ {
1598
+ line: 'alias m34=mat3x4f;',
1599
+ tokens: [
1600
+ { startIndex: 0, type: 'keyword.wgsl' },
1601
+ { startIndex: 5, type: 'white.wgsl' },
1602
+ { startIndex: 6, type: 'identifier.wgsl' },
1603
+ { startIndex: 9, type: 'operator.wgsl' },
1604
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1605
+ { startIndex: 17, type: 'delimiter.wgsl' }
1606
+ ]
1607
+ },
1608
+ {
1609
+ line: 'alias m42=mat4x2f;',
1610
+ tokens: [
1611
+ { startIndex: 0, type: 'keyword.wgsl' },
1612
+ { startIndex: 5, type: 'white.wgsl' },
1613
+ { startIndex: 6, type: 'identifier.wgsl' },
1614
+ { startIndex: 9, type: 'operator.wgsl' },
1615
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1616
+ { startIndex: 17, type: 'delimiter.wgsl' }
1617
+ ]
1618
+ },
1619
+ {
1620
+ line: 'alias m43=mat4x3f;',
1621
+ tokens: [
1622
+ { startIndex: 0, type: 'keyword.wgsl' },
1623
+ { startIndex: 5, type: 'white.wgsl' },
1624
+ { startIndex: 6, type: 'identifier.wgsl' },
1625
+ { startIndex: 9, type: 'operator.wgsl' },
1626
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1627
+ { startIndex: 17, type: 'delimiter.wgsl' }
1628
+ ]
1629
+ },
1630
+ {
1631
+ line: 'alias m44=mat4x4f;',
1632
+ tokens: [
1633
+ { startIndex: 0, type: 'keyword.wgsl' },
1634
+ { startIndex: 5, type: 'white.wgsl' },
1635
+ { startIndex: 6, type: 'identifier.wgsl' },
1636
+ { startIndex: 9, type: 'operator.wgsl' },
1637
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1638
+ { startIndex: 17, type: 'delimiter.wgsl' }
1639
+ ]
1640
+ },
1641
+ {
1642
+ line: 'alias m22_=mat2x2<f32>;',
1643
+ tokens: [
1644
+ { startIndex: 0, type: 'keyword.wgsl' },
1645
+ { startIndex: 5, type: 'white.wgsl' },
1646
+ { startIndex: 6, type: 'identifier.wgsl' },
1647
+ { startIndex: 10, type: 'operator.wgsl' },
1648
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1649
+ { startIndex: 17, type: 'operator.wgsl' },
1650
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1651
+ { startIndex: 21, type: 'delimiter.wgsl' }
1652
+ ]
1653
+ },
1654
+ {
1655
+ line: 'alias m23_=mat2x3<f32>;',
1656
+ tokens: [
1657
+ { startIndex: 0, type: 'keyword.wgsl' },
1658
+ { startIndex: 5, type: 'white.wgsl' },
1659
+ { startIndex: 6, type: 'identifier.wgsl' },
1660
+ { startIndex: 10, type: 'operator.wgsl' },
1661
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1662
+ { startIndex: 17, type: 'operator.wgsl' },
1663
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1664
+ { startIndex: 21, type: 'delimiter.wgsl' }
1665
+ ]
1666
+ },
1667
+ {
1668
+ line: 'alias m24_=mat2x4<f32>;',
1669
+ tokens: [
1670
+ { startIndex: 0, type: 'keyword.wgsl' },
1671
+ { startIndex: 5, type: 'white.wgsl' },
1672
+ { startIndex: 6, type: 'identifier.wgsl' },
1673
+ { startIndex: 10, type: 'operator.wgsl' },
1674
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1675
+ { startIndex: 17, type: 'operator.wgsl' },
1676
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1677
+ { startIndex: 21, type: 'delimiter.wgsl' }
1678
+ ]
1679
+ },
1680
+ {
1681
+ line: 'alias m32_=mat3x2<f32>;',
1682
+ tokens: [
1683
+ { startIndex: 0, type: 'keyword.wgsl' },
1684
+ { startIndex: 5, type: 'white.wgsl' },
1685
+ { startIndex: 6, type: 'identifier.wgsl' },
1686
+ { startIndex: 10, type: 'operator.wgsl' },
1687
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1688
+ { startIndex: 17, type: 'operator.wgsl' },
1689
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1690
+ { startIndex: 21, type: 'delimiter.wgsl' }
1691
+ ]
1692
+ },
1693
+ {
1694
+ line: 'alias m33_=mat3x3<f32>;',
1695
+ tokens: [
1696
+ { startIndex: 0, type: 'keyword.wgsl' },
1697
+ { startIndex: 5, type: 'white.wgsl' },
1698
+ { startIndex: 6, type: 'identifier.wgsl' },
1699
+ { startIndex: 10, type: 'operator.wgsl' },
1700
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1701
+ { startIndex: 17, type: 'operator.wgsl' },
1702
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1703
+ { startIndex: 21, type: 'delimiter.wgsl' }
1704
+ ]
1705
+ },
1706
+ {
1707
+ line: 'alias m34_=mat3x4<f32>;',
1708
+ tokens: [
1709
+ { startIndex: 0, type: 'keyword.wgsl' },
1710
+ { startIndex: 5, type: 'white.wgsl' },
1711
+ { startIndex: 6, type: 'identifier.wgsl' },
1712
+ { startIndex: 10, type: 'operator.wgsl' },
1713
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1714
+ { startIndex: 17, type: 'operator.wgsl' },
1715
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1716
+ { startIndex: 21, type: 'delimiter.wgsl' }
1717
+ ]
1718
+ },
1719
+ {
1720
+ line: 'alias m42_=mat4x2<f32>;',
1721
+ tokens: [
1722
+ { startIndex: 0, type: 'keyword.wgsl' },
1723
+ { startIndex: 5, type: 'white.wgsl' },
1724
+ { startIndex: 6, type: 'identifier.wgsl' },
1725
+ { startIndex: 10, type: 'operator.wgsl' },
1726
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1727
+ { startIndex: 17, type: 'operator.wgsl' },
1728
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1729
+ { startIndex: 21, type: 'delimiter.wgsl' }
1730
+ ]
1731
+ },
1732
+ {
1733
+ line: 'alias m43_=mat4x3<f32>;',
1734
+ tokens: [
1735
+ { startIndex: 0, type: 'keyword.wgsl' },
1736
+ { startIndex: 5, type: 'white.wgsl' },
1737
+ { startIndex: 6, type: 'identifier.wgsl' },
1738
+ { startIndex: 10, type: 'operator.wgsl' },
1739
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1740
+ { startIndex: 17, type: 'operator.wgsl' },
1741
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1742
+ { startIndex: 21, type: 'delimiter.wgsl' }
1743
+ ]
1744
+ },
1745
+ {
1746
+ line: 'alias m44_=mat4x4<f32>;',
1747
+ tokens: [
1748
+ { startIndex: 0, type: 'keyword.wgsl' },
1749
+ { startIndex: 5, type: 'white.wgsl' },
1750
+ { startIndex: 6, type: 'identifier.wgsl' },
1751
+ { startIndex: 10, type: 'operator.wgsl' },
1752
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1753
+ { startIndex: 17, type: 'operator.wgsl' },
1754
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1755
+ { startIndex: 21, type: 'delimiter.wgsl' }
1756
+ ]
1757
+ },
1758
+ {
1759
+ line: 'alias m22=mat2x2h;',
1760
+ tokens: [
1761
+ { startIndex: 0, type: 'keyword.wgsl' },
1762
+ { startIndex: 5, type: 'white.wgsl' },
1763
+ { startIndex: 6, type: 'identifier.wgsl' },
1764
+ { startIndex: 9, type: 'operator.wgsl' },
1765
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1766
+ { startIndex: 17, type: 'delimiter.wgsl' }
1767
+ ]
1768
+ },
1769
+ {
1770
+ line: 'alias m23=mat2x3h;',
1771
+ tokens: [
1772
+ { startIndex: 0, type: 'keyword.wgsl' },
1773
+ { startIndex: 5, type: 'white.wgsl' },
1774
+ { startIndex: 6, type: 'identifier.wgsl' },
1775
+ { startIndex: 9, type: 'operator.wgsl' },
1776
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1777
+ { startIndex: 17, type: 'delimiter.wgsl' }
1778
+ ]
1779
+ },
1780
+ {
1781
+ line: 'alias h24=mat2x4h;',
1782
+ tokens: [
1783
+ { startIndex: 0, type: 'keyword.wgsl' },
1784
+ { startIndex: 5, type: 'white.wgsl' },
1785
+ { startIndex: 6, type: 'identifier.wgsl' },
1786
+ { startIndex: 9, type: 'operator.wgsl' },
1787
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1788
+ { startIndex: 17, type: 'delimiter.wgsl' }
1789
+ ]
1790
+ },
1791
+ {
1792
+ line: 'alias h32=mat3x2h;',
1793
+ tokens: [
1794
+ { startIndex: 0, type: 'keyword.wgsl' },
1795
+ { startIndex: 5, type: 'white.wgsl' },
1796
+ { startIndex: 6, type: 'identifier.wgsl' },
1797
+ { startIndex: 9, type: 'operator.wgsl' },
1798
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1799
+ { startIndex: 17, type: 'delimiter.wgsl' }
1800
+ ]
1801
+ },
1802
+ {
1803
+ line: 'alias h33=mat3x3h;',
1804
+ tokens: [
1805
+ { startIndex: 0, type: 'keyword.wgsl' },
1806
+ { startIndex: 5, type: 'white.wgsl' },
1807
+ { startIndex: 6, type: 'identifier.wgsl' },
1808
+ { startIndex: 9, type: 'operator.wgsl' },
1809
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1810
+ { startIndex: 17, type: 'delimiter.wgsl' }
1811
+ ]
1812
+ },
1813
+ {
1814
+ line: 'alias h34=mat3x4h;',
1815
+ tokens: [
1816
+ { startIndex: 0, type: 'keyword.wgsl' },
1817
+ { startIndex: 5, type: 'white.wgsl' },
1818
+ { startIndex: 6, type: 'identifier.wgsl' },
1819
+ { startIndex: 9, type: 'operator.wgsl' },
1820
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1821
+ { startIndex: 17, type: 'delimiter.wgsl' }
1822
+ ]
1823
+ },
1824
+ {
1825
+ line: 'alias h42=mat4x2h;',
1826
+ tokens: [
1827
+ { startIndex: 0, type: 'keyword.wgsl' },
1828
+ { startIndex: 5, type: 'white.wgsl' },
1829
+ { startIndex: 6, type: 'identifier.wgsl' },
1830
+ { startIndex: 9, type: 'operator.wgsl' },
1831
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1832
+ { startIndex: 17, type: 'delimiter.wgsl' }
1833
+ ]
1834
+ },
1835
+ {
1836
+ line: 'alias h43=mat4x3h;',
1837
+ tokens: [
1838
+ { startIndex: 0, type: 'keyword.wgsl' },
1839
+ { startIndex: 5, type: 'white.wgsl' },
1840
+ { startIndex: 6, type: 'identifier.wgsl' },
1841
+ { startIndex: 9, type: 'operator.wgsl' },
1842
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1843
+ { startIndex: 17, type: 'delimiter.wgsl' }
1844
+ ]
1845
+ },
1846
+ {
1847
+ line: 'alias h44=mat4x4h;',
1848
+ tokens: [
1849
+ { startIndex: 0, type: 'keyword.wgsl' },
1850
+ { startIndex: 5, type: 'white.wgsl' },
1851
+ { startIndex: 6, type: 'identifier.wgsl' },
1852
+ { startIndex: 9, type: 'operator.wgsl' },
1853
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
1854
+ { startIndex: 17, type: 'delimiter.wgsl' }
1855
+ ]
1856
+ },
1857
+ {
1858
+ line: 'alias h22_=mat2x2<f16>;',
1859
+ tokens: [
1860
+ { startIndex: 0, type: 'keyword.wgsl' },
1861
+ { startIndex: 5, type: 'white.wgsl' },
1862
+ { startIndex: 6, type: 'identifier.wgsl' },
1863
+ { startIndex: 10, type: 'operator.wgsl' },
1864
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1865
+ { startIndex: 17, type: 'operator.wgsl' },
1866
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1867
+ { startIndex: 21, type: 'delimiter.wgsl' }
1868
+ ]
1869
+ },
1870
+ {
1871
+ line: 'alias h23_=mat2x3<f16>;',
1872
+ tokens: [
1873
+ { startIndex: 0, type: 'keyword.wgsl' },
1874
+ { startIndex: 5, type: 'white.wgsl' },
1875
+ { startIndex: 6, type: 'identifier.wgsl' },
1876
+ { startIndex: 10, type: 'operator.wgsl' },
1877
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1878
+ { startIndex: 17, type: 'operator.wgsl' },
1879
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1880
+ { startIndex: 21, type: 'delimiter.wgsl' }
1881
+ ]
1882
+ },
1883
+ {
1884
+ line: 'alias h24_=mat2x4<f16>;',
1885
+ tokens: [
1886
+ { startIndex: 0, type: 'keyword.wgsl' },
1887
+ { startIndex: 5, type: 'white.wgsl' },
1888
+ { startIndex: 6, type: 'identifier.wgsl' },
1889
+ { startIndex: 10, type: 'operator.wgsl' },
1890
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1891
+ { startIndex: 17, type: 'operator.wgsl' },
1892
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1893
+ { startIndex: 21, type: 'delimiter.wgsl' }
1894
+ ]
1895
+ },
1896
+ {
1897
+ line: 'alias h32_=mat3x2<f16>;',
1898
+ tokens: [
1899
+ { startIndex: 0, type: 'keyword.wgsl' },
1900
+ { startIndex: 5, type: 'white.wgsl' },
1901
+ { startIndex: 6, type: 'identifier.wgsl' },
1902
+ { startIndex: 10, type: 'operator.wgsl' },
1903
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1904
+ { startIndex: 17, type: 'operator.wgsl' },
1905
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1906
+ { startIndex: 21, type: 'delimiter.wgsl' }
1907
+ ]
1908
+ },
1909
+ {
1910
+ line: 'alias h33_=mat3x3<f16>;',
1911
+ tokens: [
1912
+ { startIndex: 0, type: 'keyword.wgsl' },
1913
+ { startIndex: 5, type: 'white.wgsl' },
1914
+ { startIndex: 6, type: 'identifier.wgsl' },
1915
+ { startIndex: 10, type: 'operator.wgsl' },
1916
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1917
+ { startIndex: 17, type: 'operator.wgsl' },
1918
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1919
+ { startIndex: 21, type: 'delimiter.wgsl' }
1920
+ ]
1921
+ },
1922
+ {
1923
+ line: 'alias h34_=mat3x4<f16>;',
1924
+ tokens: [
1925
+ { startIndex: 0, type: 'keyword.wgsl' },
1926
+ { startIndex: 5, type: 'white.wgsl' },
1927
+ { startIndex: 6, type: 'identifier.wgsl' },
1928
+ { startIndex: 10, type: 'operator.wgsl' },
1929
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1930
+ { startIndex: 17, type: 'operator.wgsl' },
1931
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1932
+ { startIndex: 21, type: 'delimiter.wgsl' }
1933
+ ]
1934
+ },
1935
+ {
1936
+ line: 'alias h42_=mat4x2<f16>;',
1937
+ tokens: [
1938
+ { startIndex: 0, type: 'keyword.wgsl' },
1939
+ { startIndex: 5, type: 'white.wgsl' },
1940
+ { startIndex: 6, type: 'identifier.wgsl' },
1941
+ { startIndex: 10, type: 'operator.wgsl' },
1942
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1943
+ { startIndex: 17, type: 'operator.wgsl' },
1944
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1945
+ { startIndex: 21, type: 'delimiter.wgsl' }
1946
+ ]
1947
+ },
1948
+ {
1949
+ line: 'alias h43_=mat4x3<f16>;',
1950
+ tokens: [
1951
+ { startIndex: 0, type: 'keyword.wgsl' },
1952
+ { startIndex: 5, type: 'white.wgsl' },
1953
+ { startIndex: 6, type: 'identifier.wgsl' },
1954
+ { startIndex: 10, type: 'operator.wgsl' },
1955
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1956
+ { startIndex: 17, type: 'operator.wgsl' },
1957
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1958
+ { startIndex: 21, type: 'delimiter.wgsl' }
1959
+ ]
1960
+ },
1961
+ {
1962
+ line: 'alias h44_=mat4x4<f16>;',
1963
+ tokens: [
1964
+ { startIndex: 0, type: 'keyword.wgsl' },
1965
+ { startIndex: 5, type: 'white.wgsl' },
1966
+ { startIndex: 6, type: 'identifier.wgsl' },
1967
+ { startIndex: 10, type: 'operator.wgsl' },
1968
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
1969
+ { startIndex: 17, type: 'operator.wgsl' },
1970
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
1971
+ { startIndex: 21, type: 'delimiter.wgsl' }
1972
+ ]
1973
+ }
1974
+ ],
1975
+ // operators
1976
+ [
1977
+ {
1978
+ line: 'const add = 0+1;',
1979
+ tokens: [
1980
+ { startIndex: 0, type: 'keyword.wgsl' },
1981
+ { startIndex: 5, type: 'white.wgsl' },
1982
+ { startIndex: 6, type: 'identifier.wgsl' },
1983
+ { startIndex: 9, type: 'white.wgsl' },
1984
+ { startIndex: 10, type: 'operator.wgsl' },
1985
+ { startIndex: 11, type: 'white.wgsl' },
1986
+ { startIndex: 12, type: 'number.wgsl' },
1987
+ { startIndex: 13, type: 'operator.wgsl' },
1988
+ { startIndex: 14, type: 'number.wgsl' },
1989
+ { startIndex: 15, type: 'delimiter.wgsl' }
1990
+ ]
1991
+ },
1992
+ {
1993
+ line: 'const sub = 0-1;',
1994
+ tokens: [
1995
+ { startIndex: 0, type: 'keyword.wgsl' },
1996
+ { startIndex: 5, type: 'white.wgsl' },
1997
+ { startIndex: 6, type: 'identifier.wgsl' },
1998
+ { startIndex: 9, type: 'white.wgsl' },
1999
+ { startIndex: 10, type: 'operator.wgsl' },
2000
+ { startIndex: 11, type: 'white.wgsl' },
2001
+ { startIndex: 12, type: 'number.wgsl' },
2002
+ { startIndex: 13, type: 'operator.wgsl' },
2003
+ { startIndex: 14, type: 'number.wgsl' },
2004
+ { startIndex: 15, type: 'delimiter.wgsl' }
2005
+ ]
2006
+ },
2007
+ {
2008
+ line: 'const mult = 1*0;',
2009
+ tokens: [
2010
+ { startIndex: 0, type: 'keyword.wgsl' },
2011
+ { startIndex: 5, type: 'white.wgsl' },
2012
+ { startIndex: 6, type: 'identifier.wgsl' },
2013
+ { startIndex: 10, type: 'white.wgsl' },
2014
+ { startIndex: 11, type: 'operator.wgsl' },
2015
+ { startIndex: 12, type: 'white.wgsl' },
2016
+ { startIndex: 13, type: 'number.wgsl' },
2017
+ { startIndex: 14, type: 'operator.wgsl' },
2018
+ { startIndex: 15, type: 'number.wgsl' },
2019
+ { startIndex: 16, type: 'delimiter.wgsl' }
2020
+ ]
2021
+ },
2022
+ {
2023
+ line: 'const div = 1/0;',
2024
+ tokens: [
2025
+ { startIndex: 0, type: 'keyword.wgsl' },
2026
+ { startIndex: 5, type: 'white.wgsl' },
2027
+ { startIndex: 6, type: 'identifier.wgsl' },
2028
+ { startIndex: 9, type: 'white.wgsl' },
2029
+ { startIndex: 10, type: 'operator.wgsl' },
2030
+ { startIndex: 11, type: 'white.wgsl' },
2031
+ { startIndex: 12, type: 'number.wgsl' },
2032
+ { startIndex: 13, type: 'operator.wgsl' },
2033
+ { startIndex: 14, type: 'number.wgsl' },
2034
+ { startIndex: 15, type: 'delimiter.wgsl' }
2035
+ ]
2036
+ },
2037
+ {
2038
+ line: 'const rem = 2%1;',
2039
+ tokens: [
2040
+ { startIndex: 0, type: 'keyword.wgsl' },
2041
+ { startIndex: 5, type: 'white.wgsl' },
2042
+ { startIndex: 6, type: 'identifier.wgsl' },
2043
+ { startIndex: 9, type: 'white.wgsl' },
2044
+ { startIndex: 10, type: 'operator.wgsl' },
2045
+ { startIndex: 11, type: 'white.wgsl' },
2046
+ { startIndex: 12, type: 'number.wgsl' },
2047
+ { startIndex: 13, type: 'operator.wgsl' },
2048
+ { startIndex: 14, type: 'number.wgsl' },
2049
+ { startIndex: 15, type: 'delimiter.wgsl' }
2050
+ ]
2051
+ },
2052
+ {
2053
+ line: 'const xor = 1^2;',
2054
+ tokens: [
2055
+ { startIndex: 0, type: 'keyword.wgsl' },
2056
+ { startIndex: 5, type: 'white.wgsl' },
2057
+ { startIndex: 6, type: 'identifier.wgsl' },
2058
+ { startIndex: 9, type: 'white.wgsl' },
2059
+ { startIndex: 10, type: 'operator.wgsl' },
2060
+ { startIndex: 11, type: 'white.wgsl' },
2061
+ { startIndex: 12, type: 'number.wgsl' },
2062
+ { startIndex: 13, type: 'delimiter.wgsl' },
2063
+ { startIndex: 14, type: 'number.wgsl' },
2064
+ { startIndex: 15, type: 'delimiter.wgsl' }
2065
+ ]
2066
+ },
2067
+ {
2068
+ line: 'const or = 1|2;',
2069
+ tokens: [
2070
+ { startIndex: 0, type: 'keyword.wgsl' },
2071
+ { startIndex: 5, type: 'white.wgsl' },
2072
+ { startIndex: 6, type: 'identifier.wgsl' },
2073
+ { startIndex: 8, type: 'white.wgsl' },
2074
+ { startIndex: 9, type: 'operator.wgsl' },
2075
+ { startIndex: 10, type: 'white.wgsl' },
2076
+ { startIndex: 11, type: 'number.wgsl' },
2077
+ { startIndex: 12, type: 'operator.wgsl' },
2078
+ { startIndex: 13, type: 'number.wgsl' },
2079
+ { startIndex: 14, type: 'delimiter.wgsl' }
2080
+ ]
2081
+ },
2082
+ {
2083
+ line: 'const not = !false;',
2084
+ tokens: [
2085
+ { startIndex: 0, type: 'keyword.wgsl' },
2086
+ { startIndex: 5, type: 'white.wgsl' },
2087
+ { startIndex: 6, type: 'identifier.wgsl' },
2088
+ { startIndex: 9, type: 'white.wgsl' },
2089
+ { startIndex: 10, type: 'operator.wgsl' },
2090
+ { startIndex: 11, type: 'white.wgsl' },
2091
+ { startIndex: 12, type: 'delimiter.wgsl' },
2092
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
2093
+ { startIndex: 18, type: 'delimiter.wgsl' }
2094
+ ]
2095
+ },
2096
+ {
2097
+ line: 'const complement = ~1u;',
2098
+ tokens: [
2099
+ { startIndex: 0, type: 'keyword.wgsl' },
2100
+ { startIndex: 5, type: 'white.wgsl' },
2101
+ { startIndex: 6, type: 'identifier.wgsl' },
2102
+ { startIndex: 16, type: 'white.wgsl' },
2103
+ { startIndex: 17, type: 'operator.wgsl' },
2104
+ { startIndex: 18, type: 'white.wgsl' },
2105
+ { startIndex: 19, type: 'delimiter.wgsl' },
2106
+ { startIndex: 20, type: 'number.wgsl' },
2107
+ { startIndex: 22, type: 'delimiter.wgsl' }
2108
+ ]
2109
+ },
2110
+ {
2111
+ line: 'const less = 1<0;',
2112
+ tokens: [
2113
+ { startIndex: 0, type: 'keyword.wgsl' },
2114
+ { startIndex: 5, type: 'white.wgsl' },
2115
+ { startIndex: 6, type: 'identifier.wgsl' },
2116
+ { startIndex: 10, type: 'white.wgsl' },
2117
+ { startIndex: 11, type: 'operator.wgsl' },
2118
+ { startIndex: 12, type: 'white.wgsl' },
2119
+ { startIndex: 13, type: 'number.wgsl' },
2120
+ { startIndex: 14, type: 'operator.wgsl' },
2121
+ { startIndex: 15, type: 'number.wgsl' },
2122
+ { startIndex: 16, type: 'delimiter.wgsl' }
2123
+ ]
2124
+ },
2125
+ {
2126
+ line: 'const lesseq = 1<=0;',
2127
+ tokens: [
2128
+ { startIndex: 0, type: 'keyword.wgsl' },
2129
+ { startIndex: 5, type: 'white.wgsl' },
2130
+ { startIndex: 6, type: 'identifier.wgsl' },
2131
+ { startIndex: 12, type: 'white.wgsl' },
2132
+ { startIndex: 13, type: 'operator.wgsl' },
2133
+ { startIndex: 14, type: 'white.wgsl' },
2134
+ { startIndex: 15, type: 'number.wgsl' },
2135
+ { startIndex: 16, type: 'operator.wgsl' },
2136
+ { startIndex: 18, type: 'number.wgsl' },
2137
+ { startIndex: 19, type: 'delimiter.wgsl' }
2138
+ ]
2139
+ },
2140
+ {
2141
+ line: 'const equal = 1==2;',
2142
+ tokens: [
2143
+ { startIndex: 0, type: 'keyword.wgsl' },
2144
+ { startIndex: 5, type: 'white.wgsl' },
2145
+ { startIndex: 6, type: 'identifier.wgsl' },
2146
+ { startIndex: 11, type: 'white.wgsl' },
2147
+ { startIndex: 12, type: 'operator.wgsl' },
2148
+ { startIndex: 13, type: 'white.wgsl' },
2149
+ { startIndex: 14, type: 'number.wgsl' },
2150
+ { startIndex: 15, type: 'operator.wgsl' },
2151
+ { startIndex: 17, type: 'number.wgsl' },
2152
+ { startIndex: 18, type: 'delimiter.wgsl' }
2153
+ ]
2154
+ },
2155
+ {
2156
+ line: 'const greater = 1>2;',
2157
+ tokens: [
2158
+ { startIndex: 0, type: 'keyword.wgsl' },
2159
+ { startIndex: 5, type: 'white.wgsl' },
2160
+ { startIndex: 6, type: 'identifier.wgsl' },
2161
+ { startIndex: 13, type: 'white.wgsl' },
2162
+ { startIndex: 14, type: 'operator.wgsl' },
2163
+ { startIndex: 15, type: 'white.wgsl' },
2164
+ { startIndex: 16, type: 'number.wgsl' },
2165
+ { startIndex: 17, type: 'operator.wgsl' },
2166
+ { startIndex: 18, type: 'number.wgsl' },
2167
+ { startIndex: 19, type: 'delimiter.wgsl' }
2168
+ ]
2169
+ },
2170
+ {
2171
+ line: 'const greatereq = 1>=2;',
2172
+ tokens: [
2173
+ { startIndex: 0, type: 'keyword.wgsl' },
2174
+ { startIndex: 5, type: 'white.wgsl' },
2175
+ { startIndex: 6, type: 'identifier.wgsl' },
2176
+ { startIndex: 15, type: 'white.wgsl' },
2177
+ { startIndex: 16, type: 'operator.wgsl' },
2178
+ { startIndex: 17, type: 'white.wgsl' },
2179
+ { startIndex: 18, type: 'number.wgsl' },
2180
+ { startIndex: 19, type: 'operator.wgsl' },
2181
+ { startIndex: 21, type: 'number.wgsl' },
2182
+ { startIndex: 22, type: 'delimiter.wgsl' }
2183
+ ]
2184
+ },
2185
+ {
2186
+ line: 'const noteq = 1!=2;',
2187
+ tokens: [
2188
+ { startIndex: 0, type: 'keyword.wgsl' },
2189
+ { startIndex: 5, type: 'white.wgsl' },
2190
+ { startIndex: 6, type: 'identifier.wgsl' },
2191
+ { startIndex: 11, type: 'white.wgsl' },
2192
+ { startIndex: 12, type: 'operator.wgsl' },
2193
+ { startIndex: 13, type: 'white.wgsl' },
2194
+ { startIndex: 14, type: 'number.wgsl' },
2195
+ { startIndex: 15, type: 'operator.wgsl' },
2196
+ { startIndex: 17, type: 'number.wgsl' },
2197
+ { startIndex: 18, type: 'delimiter.wgsl' }
2198
+ ]
2199
+ },
2200
+ {
2201
+ line: 'const leftshift = 1<<2;',
2202
+ tokens: [
2203
+ { startIndex: 0, type: 'keyword.wgsl' },
2204
+ { startIndex: 5, type: 'white.wgsl' },
2205
+ { startIndex: 6, type: 'identifier.wgsl' },
2206
+ { startIndex: 15, type: 'white.wgsl' },
2207
+ { startIndex: 16, type: 'operator.wgsl' },
2208
+ { startIndex: 17, type: 'white.wgsl' },
2209
+ { startIndex: 18, type: 'number.wgsl' },
2210
+ { startIndex: 19, type: 'operator.wgsl' },
2211
+ { startIndex: 21, type: 'number.wgsl' },
2212
+ { startIndex: 22, type: 'delimiter.wgsl' }
2213
+ ]
2214
+ },
2215
+ {
2216
+ line: 'const rightshift = 2>>1;',
2217
+ tokens: [
2218
+ { startIndex: 0, type: 'keyword.wgsl' },
2219
+ { startIndex: 5, type: 'white.wgsl' },
2220
+ { startIndex: 6, type: 'identifier.wgsl' },
2221
+ { startIndex: 16, type: 'white.wgsl' },
2222
+ { startIndex: 17, type: 'operator.wgsl' },
2223
+ { startIndex: 18, type: 'white.wgsl' },
2224
+ { startIndex: 19, type: 'number.wgsl' },
2225
+ { startIndex: 20, type: 'operator.wgsl' },
2226
+ { startIndex: 22, type: 'number.wgsl' },
2227
+ { startIndex: 23, type: 'delimiter.wgsl' }
2228
+ ]
2229
+ },
2230
+ {
2231
+ line: 'fn arith() -> i32 {',
2232
+ tokens: [
2233
+ { startIndex: 0, type: 'keyword.wgsl' },
2234
+ { startIndex: 2, type: 'white.wgsl' },
2235
+ { startIndex: 3, type: 'identifier.wgsl' },
2236
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
2237
+ { startIndex: 10, type: 'white.wgsl' },
2238
+ { startIndex: 11, type: 'operator.wgsl' },
2239
+ { startIndex: 13, type: 'white.wgsl' },
2240
+ { startIndex: 14, type: 'variable.predefined.wgsl' },
2241
+ { startIndex: 17, type: 'white.wgsl' },
2242
+ { startIndex: 18, type: 'delimiter.curly.wgsl' }
2243
+ ]
2244
+ },
2245
+ {
2246
+ line: 'var a: i32;',
2247
+ tokens: [
2248
+ { startIndex: 0, type: 'keyword.wgsl' },
2249
+ { startIndex: 3, type: 'white.wgsl' },
2250
+ { startIndex: 4, type: 'identifier.wgsl' },
2251
+ { startIndex: 5, type: 'delimiter.wgsl' },
2252
+ { startIndex: 6, type: 'white.wgsl' },
2253
+ { startIndex: 7, type: 'variable.predefined.wgsl' },
2254
+ { startIndex: 10, type: 'delimiter.wgsl' }
2255
+ ]
2256
+ },
2257
+ {
2258
+ line: 'a += 1;',
2259
+ tokens: [
2260
+ { startIndex: 0, type: 'identifier.wgsl' },
2261
+ { startIndex: 1, type: 'white.wgsl' },
2262
+ { startIndex: 2, type: 'operator.wgsl' },
2263
+ { startIndex: 4, type: 'white.wgsl' },
2264
+ { startIndex: 5, type: 'number.wgsl' },
2265
+ { startIndex: 6, type: 'delimiter.wgsl' }
2266
+ ]
2267
+ },
2268
+ {
2269
+ line: 'a -= 1;',
2270
+ tokens: [
2271
+ { startIndex: 0, type: 'identifier.wgsl' },
2272
+ { startIndex: 1, type: 'white.wgsl' },
2273
+ { startIndex: 2, type: 'operator.wgsl' },
2274
+ { startIndex: 4, type: 'white.wgsl' },
2275
+ { startIndex: 5, type: 'number.wgsl' },
2276
+ { startIndex: 6, type: 'delimiter.wgsl' }
2277
+ ]
2278
+ },
2279
+ {
2280
+ line: 'a *= 1;',
2281
+ tokens: [
2282
+ { startIndex: 0, type: 'identifier.wgsl' },
2283
+ { startIndex: 1, type: 'white.wgsl' },
2284
+ { startIndex: 2, type: 'operator.wgsl' },
2285
+ { startIndex: 4, type: 'white.wgsl' },
2286
+ { startIndex: 5, type: 'number.wgsl' },
2287
+ { startIndex: 6, type: 'delimiter.wgsl' }
2288
+ ]
2289
+ },
2290
+ {
2291
+ line: 'a /= 1;',
2292
+ tokens: [
2293
+ { startIndex: 0, type: 'identifier.wgsl' },
2294
+ { startIndex: 1, type: 'white.wgsl' },
2295
+ { startIndex: 2, type: 'operator.wgsl' },
2296
+ { startIndex: 4, type: 'white.wgsl' },
2297
+ { startIndex: 5, type: 'number.wgsl' },
2298
+ { startIndex: 6, type: 'delimiter.wgsl' }
2299
+ ]
2300
+ },
2301
+ {
2302
+ line: 'a %= 2;',
2303
+ tokens: [
2304
+ { startIndex: 0, type: 'identifier.wgsl' },
2305
+ { startIndex: 1, type: 'white.wgsl' },
2306
+ { startIndex: 2, type: 'operator.wgsl' },
2307
+ { startIndex: 4, type: 'white.wgsl' },
2308
+ { startIndex: 5, type: 'number.wgsl' },
2309
+ { startIndex: 6, type: 'delimiter.wgsl' }
2310
+ ]
2311
+ },
2312
+ {
2313
+ line: 'a ^= 2;',
2314
+ tokens: [
2315
+ { startIndex: 0, type: 'identifier.wgsl' },
2316
+ { startIndex: 1, type: 'white.wgsl' },
2317
+ { startIndex: 2, type: 'operator.wgsl' },
2318
+ { startIndex: 4, type: 'white.wgsl' },
2319
+ { startIndex: 5, type: 'number.wgsl' },
2320
+ { startIndex: 6, type: 'delimiter.wgsl' }
2321
+ ]
2322
+ },
2323
+ {
2324
+ line: 'a &= 2;',
2325
+ tokens: [
2326
+ { startIndex: 0, type: 'identifier.wgsl' },
2327
+ { startIndex: 1, type: 'white.wgsl' },
2328
+ { startIndex: 2, type: 'operator.wgsl' },
2329
+ { startIndex: 4, type: 'white.wgsl' },
2330
+ { startIndex: 5, type: 'number.wgsl' },
2331
+ { startIndex: 6, type: 'delimiter.wgsl' }
2332
+ ]
2333
+ },
2334
+ {
2335
+ line: 'a |= 2;',
2336
+ tokens: [
2337
+ { startIndex: 0, type: 'identifier.wgsl' },
2338
+ { startIndex: 1, type: 'white.wgsl' },
2339
+ { startIndex: 2, type: 'operator.wgsl' },
2340
+ { startIndex: 4, type: 'white.wgsl' },
2341
+ { startIndex: 5, type: 'number.wgsl' },
2342
+ { startIndex: 6, type: 'delimiter.wgsl' }
2343
+ ]
2344
+ },
2345
+ {
2346
+ line: 'a <<= 1;',
2347
+ tokens: [
2348
+ { startIndex: 0, type: 'identifier.wgsl' },
2349
+ { startIndex: 1, type: 'white.wgsl' },
2350
+ { startIndex: 2, type: 'operator.wgsl' },
2351
+ { startIndex: 5, type: 'white.wgsl' },
2352
+ { startIndex: 6, type: 'number.wgsl' },
2353
+ { startIndex: 7, type: 'delimiter.wgsl' }
2354
+ ]
2355
+ },
2356
+ {
2357
+ line: 'a >>= 1;',
2358
+ tokens: [
2359
+ { startIndex: 0, type: 'identifier.wgsl' },
2360
+ { startIndex: 1, type: 'white.wgsl' },
2361
+ { startIndex: 2, type: 'operator.wgsl' },
2362
+ { startIndex: 5, type: 'white.wgsl' },
2363
+ { startIndex: 6, type: 'number.wgsl' },
2364
+ { startIndex: 7, type: 'delimiter.wgsl' }
2365
+ ]
2366
+ },
2367
+ {
2368
+ line: 'a++;',
2369
+ tokens: [
2370
+ { startIndex: 0, type: 'identifier.wgsl' },
2371
+ { startIndex: 1, type: 'delimiter.wgsl' }
2372
+ ]
2373
+ },
2374
+ {
2375
+ line: 'a--;',
2376
+ tokens: [
2377
+ { startIndex: 0, type: 'identifier.wgsl' },
2378
+ { startIndex: 1, type: 'delimiter.wgsl' }
2379
+ ]
2380
+ },
2381
+ {
2382
+ line: 'let b = true&&false;',
2383
+ tokens: [
2384
+ { startIndex: 0, type: 'keyword.wgsl' },
2385
+ { startIndex: 3, type: 'white.wgsl' },
2386
+ { startIndex: 4, type: 'identifier.wgsl' },
2387
+ { startIndex: 5, type: 'white.wgsl' },
2388
+ { startIndex: 6, type: 'operator.wgsl' },
2389
+ { startIndex: 7, type: 'white.wgsl' },
2390
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2391
+ { startIndex: 12, type: 'operator.wgsl' },
2392
+ { startIndex: 14, type: 'variable.predefined.wgsl' },
2393
+ { startIndex: 19, type: 'delimiter.wgsl' }
2394
+ ]
2395
+ },
2396
+ {
2397
+ line: 'let c = true||false;',
2398
+ tokens: [
2399
+ { startIndex: 0, type: 'keyword.wgsl' },
2400
+ { startIndex: 3, type: 'white.wgsl' },
2401
+ { startIndex: 4, type: 'identifier.wgsl' },
2402
+ { startIndex: 5, type: 'white.wgsl' },
2403
+ { startIndex: 6, type: 'operator.wgsl' },
2404
+ { startIndex: 7, type: 'white.wgsl' },
2405
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2406
+ { startIndex: 12, type: 'operator.wgsl' },
2407
+ { startIndex: 14, type: 'variable.predefined.wgsl' },
2408
+ { startIndex: 19, type: 'delimiter.wgsl' }
2409
+ ]
2410
+ },
2411
+ {
2412
+ line: 'return a;',
2413
+ tokens: [
2414
+ { startIndex: 0, type: 'keyword.wgsl' },
2415
+ { startIndex: 6, type: 'white.wgsl' },
2416
+ { startIndex: 7, type: 'identifier.wgsl' },
2417
+ { startIndex: 8, type: 'delimiter.wgsl' }
2418
+ ]
2419
+ },
2420
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.wgsl' }] }
2421
+ ],
2422
+ // predeclared
2423
+ [
2424
+ {
2425
+ line: 'read write read_write',
2426
+ tokens: [
2427
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2428
+ { startIndex: 4, type: 'white.wgsl' },
2429
+ { startIndex: 5, type: 'variable.predefined.wgsl' },
2430
+ { startIndex: 10, type: 'white.wgsl' },
2431
+ { startIndex: 11, type: 'variable.predefined.wgsl' }
2432
+ ]
2433
+ },
2434
+ {
2435
+ line: 'function private workgroup uniform storage',
2436
+ tokens: [
2437
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2438
+ { startIndex: 8, type: 'white.wgsl' },
2439
+ { startIndex: 9, type: 'variable.predefined.wgsl' },
2440
+ { startIndex: 16, type: 'white.wgsl' },
2441
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
2442
+ { startIndex: 26, type: 'white.wgsl' },
2443
+ { startIndex: 27, type: 'variable.predefined.wgsl' },
2444
+ { startIndex: 34, type: 'white.wgsl' },
2445
+ { startIndex: 35, type: 'variable.predefined.wgsl' }
2446
+ ]
2447
+ },
2448
+ {
2449
+ line: 'perspective linear flat',
2450
+ tokens: [
2451
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2452
+ { startIndex: 11, type: 'white.wgsl' },
2453
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
2454
+ { startIndex: 18, type: 'white.wgsl' },
2455
+ { startIndex: 19, type: 'variable.predefined.wgsl' }
2456
+ ]
2457
+ },
2458
+ {
2459
+ line: 'center centroid sample',
2460
+ tokens: [
2461
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2462
+ { startIndex: 6, type: 'white.wgsl' },
2463
+ { startIndex: 7, type: 'variable.predefined.wgsl' },
2464
+ { startIndex: 15, type: 'white.wgsl' },
2465
+ { startIndex: 16, type: 'variable.predefined.wgsl' }
2466
+ ]
2467
+ },
2468
+ {
2469
+ line: 'vertex_index instance_index position front_facing frag_depth',
2470
+ tokens: [
2471
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2472
+ { startIndex: 12, type: 'white.wgsl' },
2473
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
2474
+ { startIndex: 27, type: 'white.wgsl' },
2475
+ { startIndex: 28, type: 'variable.predefined.wgsl' },
2476
+ { startIndex: 36, type: 'white.wgsl' },
2477
+ { startIndex: 37, type: 'variable.predefined.wgsl' },
2478
+ { startIndex: 49, type: 'white.wgsl' },
2479
+ { startIndex: 50, type: 'variable.predefined.wgsl' }
2480
+ ]
2481
+ },
2482
+ {
2483
+ line: 'local_invocation_id local_invocation_index',
2484
+ tokens: [
2485
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2486
+ { startIndex: 19, type: 'white.wgsl' },
2487
+ { startIndex: 20, type: 'variable.predefined.wgsl' }
2488
+ ]
2489
+ },
2490
+ {
2491
+ line: 'global_invocation_id workgroup_id num_workgroups',
2492
+ tokens: [
2493
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2494
+ { startIndex: 20, type: 'white.wgsl' },
2495
+ { startIndex: 21, type: 'variable.predefined.wgsl' },
2496
+ { startIndex: 33, type: 'white.wgsl' },
2497
+ { startIndex: 34, type: 'variable.predefined.wgsl' }
2498
+ ]
2499
+ },
2500
+ {
2501
+ line: 'sample_index sample_mask',
2502
+ tokens: [
2503
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2504
+ { startIndex: 12, type: 'white.wgsl' },
2505
+ { startIndex: 13, type: 'variable.predefined.wgsl' }
2506
+ ]
2507
+ },
2508
+ { line: 'rgba8unorm', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2509
+ { line: 'rgba8snorm', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2510
+ { line: 'rgba8uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2511
+ { line: 'rgba8sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2512
+ { line: 'rgba16uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2513
+ { line: 'rgba16sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2514
+ { line: 'rgba16float', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2515
+ { line: 'r32uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2516
+ { line: 'r32sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2517
+ { line: 'r32float', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2518
+ { line: 'rg32uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2519
+ { line: 'rg32sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2520
+ { line: 'rg32float', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2521
+ { line: 'rgba32uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2522
+ { line: 'rgba32sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2523
+ { line: 'rgba32float', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2524
+ { line: 'bgra8unorm', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2525
+ { line: '', tokens: [] },
2526
+ { line: 'bool', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2527
+ { line: 'f16', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2528
+ { line: 'f32', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2529
+ { line: 'i32', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2530
+ {
2531
+ line: 'sampler sampler_comparison',
2532
+ tokens: [
2533
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2534
+ { startIndex: 7, type: 'white.wgsl' },
2535
+ { startIndex: 8, type: 'variable.predefined.wgsl' }
2536
+ ]
2537
+ },
2538
+ {
2539
+ line: 'texture_depth_2d',
2540
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2541
+ },
2542
+ {
2543
+ line: 'texture_depth_2d_array',
2544
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2545
+ },
2546
+ {
2547
+ line: 'texture_depth_cube',
2548
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2549
+ },
2550
+ {
2551
+ line: 'texture_depth_cube_array',
2552
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2553
+ },
2554
+ {
2555
+ line: 'texture_depth_multisampled_2d',
2556
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2557
+ },
2558
+ {
2559
+ line: 'texture_external',
2560
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2561
+ },
2562
+ {
2563
+ line: 'texture_external',
2564
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2565
+ },
2566
+ { line: 'u32', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2567
+ { line: '', tokens: [] },
2568
+ { line: 'array', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2569
+ { line: 'atomic', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2570
+ { line: 'mat2x2', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2571
+ { line: 'mat2x3', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2572
+ { line: 'mat2x4', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2573
+ { line: 'mat3x2', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2574
+ { line: 'mat3x3', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2575
+ { line: 'mat3x4', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2576
+ { line: 'mat4x2', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2577
+ { line: 'mat4x3', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2578
+ { line: 'mat4x4', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2579
+ { line: 'ptr', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2580
+ { line: 'texture_1d', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2581
+ { line: 'texture_2d', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2582
+ {
2583
+ line: 'texture_2d_array',
2584
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2585
+ },
2586
+ { line: 'texture_3d', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2587
+ { line: 'texture_cube', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2588
+ {
2589
+ line: 'texture_cube_array',
2590
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2591
+ },
2592
+ {
2593
+ line: 'texture_multisampled_2d',
2594
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2595
+ },
2596
+ {
2597
+ line: 'texture_storage_1d',
2598
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2599
+ },
2600
+ {
2601
+ line: 'texture_storage_2d',
2602
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2603
+ },
2604
+ {
2605
+ line: 'texture_storage_2d_array',
2606
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2607
+ },
2608
+ {
2609
+ line: 'texture_storage_3d',
2610
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2611
+ },
2612
+ { line: 'vec2', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2613
+ { line: 'vec3', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2614
+ { line: 'vec4', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] },
2615
+ { line: '', tokens: [] },
2616
+ {
2617
+ line: 'vec2i vec3i vec4i',
2618
+ tokens: [
2619
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2620
+ { startIndex: 5, type: 'white.wgsl' },
2621
+ { startIndex: 6, type: 'variable.predefined.wgsl' },
2622
+ { startIndex: 11, type: 'white.wgsl' },
2623
+ { startIndex: 12, type: 'variable.predefined.wgsl' }
2624
+ ]
2625
+ },
2626
+ {
2627
+ line: 'vec2u vec3u vec4u',
2628
+ tokens: [
2629
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2630
+ { startIndex: 5, type: 'white.wgsl' },
2631
+ { startIndex: 6, type: 'variable.predefined.wgsl' },
2632
+ { startIndex: 11, type: 'white.wgsl' },
2633
+ { startIndex: 12, type: 'variable.predefined.wgsl' }
2634
+ ]
2635
+ },
2636
+ {
2637
+ line: 'vec2f vec3f vec4f',
2638
+ tokens: [
2639
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2640
+ { startIndex: 5, type: 'white.wgsl' },
2641
+ { startIndex: 6, type: 'variable.predefined.wgsl' },
2642
+ { startIndex: 11, type: 'white.wgsl' },
2643
+ { startIndex: 12, type: 'variable.predefined.wgsl' }
2644
+ ]
2645
+ },
2646
+ {
2647
+ line: 'vec2h vec3h vec4h',
2648
+ tokens: [
2649
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2650
+ { startIndex: 5, type: 'white.wgsl' },
2651
+ { startIndex: 6, type: 'variable.predefined.wgsl' },
2652
+ { startIndex: 11, type: 'white.wgsl' },
2653
+ { startIndex: 12, type: 'variable.predefined.wgsl' }
2654
+ ]
2655
+ },
2656
+ {
2657
+ line: 'mat2x2f mat2x3f mat2x4f',
2658
+ tokens: [
2659
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2660
+ { startIndex: 7, type: 'white.wgsl' },
2661
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2662
+ { startIndex: 15, type: 'white.wgsl' },
2663
+ { startIndex: 16, type: 'variable.predefined.wgsl' }
2664
+ ]
2665
+ },
2666
+ {
2667
+ line: 'mat3x2f mat3x3f mat3x4f',
2668
+ tokens: [
2669
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2670
+ { startIndex: 7, type: 'white.wgsl' },
2671
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2672
+ { startIndex: 15, type: 'white.wgsl' },
2673
+ { startIndex: 16, type: 'variable.predefined.wgsl' }
2674
+ ]
2675
+ },
2676
+ {
2677
+ line: 'mat4x2f mat4x3f mat4x4f',
2678
+ tokens: [
2679
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2680
+ { startIndex: 7, type: 'white.wgsl' },
2681
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2682
+ { startIndex: 15, type: 'white.wgsl' },
2683
+ { startIndex: 16, type: 'variable.predefined.wgsl' }
2684
+ ]
2685
+ },
2686
+ {
2687
+ line: 'mat2x2h mat2x3h mat2x4h',
2688
+ tokens: [
2689
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2690
+ { startIndex: 7, type: 'white.wgsl' },
2691
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2692
+ { startIndex: 15, type: 'white.wgsl' },
2693
+ { startIndex: 16, type: 'variable.predefined.wgsl' }
2694
+ ]
2695
+ },
2696
+ {
2697
+ line: 'mat3x2h mat3x3h mat3x4h',
2698
+ tokens: [
2699
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2700
+ { startIndex: 7, type: 'white.wgsl' },
2701
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2702
+ { startIndex: 15, type: 'white.wgsl' },
2703
+ { startIndex: 16, type: 'variable.predefined.wgsl' }
2704
+ ]
2705
+ },
2706
+ {
2707
+ line: 'mat4x2h mat4x3h mat4x4h',
2708
+ tokens: [
2709
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2710
+ { startIndex: 7, type: 'white.wgsl' },
2711
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2712
+ { startIndex: 15, type: 'white.wgsl' },
2713
+ { startIndex: 16, type: 'variable.predefined.wgsl' }
2714
+ ]
2715
+ },
2716
+ { line: '', tokens: [] },
2717
+ {
2718
+ line: 'bitcast all any select arrayLength abs acos acosh asin asinh atan atanh atan2',
2719
+ tokens: [
2720
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2721
+ { startIndex: 7, type: 'white.wgsl' },
2722
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2723
+ { startIndex: 11, type: 'white.wgsl' },
2724
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
2725
+ { startIndex: 15, type: 'white.wgsl' },
2726
+ { startIndex: 16, type: 'variable.predefined.wgsl' },
2727
+ { startIndex: 22, type: 'white.wgsl' },
2728
+ { startIndex: 23, type: 'variable.predefined.wgsl' },
2729
+ { startIndex: 34, type: 'white.wgsl' },
2730
+ { startIndex: 35, type: 'variable.predefined.wgsl' },
2731
+ { startIndex: 38, type: 'white.wgsl' },
2732
+ { startIndex: 39, type: 'variable.predefined.wgsl' },
2733
+ { startIndex: 43, type: 'white.wgsl' },
2734
+ { startIndex: 44, type: 'variable.predefined.wgsl' },
2735
+ { startIndex: 49, type: 'white.wgsl' },
2736
+ { startIndex: 50, type: 'variable.predefined.wgsl' },
2737
+ { startIndex: 54, type: 'white.wgsl' },
2738
+ { startIndex: 55, type: 'variable.predefined.wgsl' },
2739
+ { startIndex: 60, type: 'white.wgsl' },
2740
+ { startIndex: 61, type: 'variable.predefined.wgsl' },
2741
+ { startIndex: 65, type: 'white.wgsl' },
2742
+ { startIndex: 66, type: 'variable.predefined.wgsl' },
2743
+ { startIndex: 71, type: 'white.wgsl' },
2744
+ { startIndex: 72, type: 'variable.predefined.wgsl' }
2745
+ ]
2746
+ },
2747
+ {
2748
+ line: 'ceil clamp cos cosh countLeadingZeros countOneBits countTrailingZeros cross',
2749
+ tokens: [
2750
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2751
+ { startIndex: 4, type: 'white.wgsl' },
2752
+ { startIndex: 5, type: 'variable.predefined.wgsl' },
2753
+ { startIndex: 10, type: 'white.wgsl' },
2754
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
2755
+ { startIndex: 14, type: 'white.wgsl' },
2756
+ { startIndex: 15, type: 'variable.predefined.wgsl' },
2757
+ { startIndex: 19, type: 'white.wgsl' },
2758
+ { startIndex: 20, type: 'variable.predefined.wgsl' },
2759
+ { startIndex: 37, type: 'white.wgsl' },
2760
+ { startIndex: 38, type: 'variable.predefined.wgsl' },
2761
+ { startIndex: 50, type: 'white.wgsl' },
2762
+ { startIndex: 51, type: 'variable.predefined.wgsl' },
2763
+ { startIndex: 69, type: 'white.wgsl' },
2764
+ { startIndex: 70, type: 'variable.predefined.wgsl' }
2765
+ ]
2766
+ },
2767
+ {
2768
+ line: 'degrees determinant distance dot exp exp2 extractBits faceForward firstLeadingBit',
2769
+ tokens: [
2770
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2771
+ { startIndex: 7, type: 'white.wgsl' },
2772
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
2773
+ { startIndex: 19, type: 'white.wgsl' },
2774
+ { startIndex: 20, type: 'variable.predefined.wgsl' },
2775
+ { startIndex: 28, type: 'white.wgsl' },
2776
+ { startIndex: 29, type: 'variable.predefined.wgsl' },
2777
+ { startIndex: 32, type: 'white.wgsl' },
2778
+ { startIndex: 33, type: 'variable.predefined.wgsl' },
2779
+ { startIndex: 36, type: 'white.wgsl' },
2780
+ { startIndex: 37, type: 'variable.predefined.wgsl' },
2781
+ { startIndex: 41, type: 'white.wgsl' },
2782
+ { startIndex: 42, type: 'variable.predefined.wgsl' },
2783
+ { startIndex: 53, type: 'white.wgsl' },
2784
+ { startIndex: 54, type: 'variable.predefined.wgsl' },
2785
+ { startIndex: 65, type: 'white.wgsl' },
2786
+ { startIndex: 66, type: 'variable.predefined.wgsl' }
2787
+ ]
2788
+ },
2789
+ {
2790
+ line: 'firstTrailingBit floor fma fract frexp inverseBits inverseSqrt ldexp length',
2791
+ tokens: [
2792
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2793
+ { startIndex: 16, type: 'white.wgsl' },
2794
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
2795
+ { startIndex: 22, type: 'white.wgsl' },
2796
+ { startIndex: 23, type: 'variable.predefined.wgsl' },
2797
+ { startIndex: 26, type: 'white.wgsl' },
2798
+ { startIndex: 27, type: 'variable.predefined.wgsl' },
2799
+ { startIndex: 32, type: 'white.wgsl' },
2800
+ { startIndex: 33, type: 'variable.predefined.wgsl' },
2801
+ { startIndex: 38, type: 'white.wgsl' },
2802
+ { startIndex: 39, type: 'variable.predefined.wgsl' },
2803
+ { startIndex: 50, type: 'white.wgsl' },
2804
+ { startIndex: 51, type: 'variable.predefined.wgsl' },
2805
+ { startIndex: 62, type: 'white.wgsl' },
2806
+ { startIndex: 63, type: 'variable.predefined.wgsl' },
2807
+ { startIndex: 68, type: 'white.wgsl' },
2808
+ { startIndex: 69, type: 'variable.predefined.wgsl' }
2809
+ ]
2810
+ },
2811
+ {
2812
+ line: 'log log2 max min mix modf normalize pow quantizeToF16 radians reflect refract',
2813
+ tokens: [
2814
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2815
+ { startIndex: 3, type: 'white.wgsl' },
2816
+ { startIndex: 4, type: 'variable.predefined.wgsl' },
2817
+ { startIndex: 8, type: 'white.wgsl' },
2818
+ { startIndex: 9, type: 'variable.predefined.wgsl' },
2819
+ { startIndex: 12, type: 'white.wgsl' },
2820
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
2821
+ { startIndex: 16, type: 'white.wgsl' },
2822
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
2823
+ { startIndex: 20, type: 'white.wgsl' },
2824
+ { startIndex: 21, type: 'variable.predefined.wgsl' },
2825
+ { startIndex: 25, type: 'white.wgsl' },
2826
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
2827
+ { startIndex: 35, type: 'white.wgsl' },
2828
+ { startIndex: 36, type: 'variable.predefined.wgsl' },
2829
+ { startIndex: 39, type: 'white.wgsl' },
2830
+ { startIndex: 40, type: 'variable.predefined.wgsl' },
2831
+ { startIndex: 53, type: 'white.wgsl' },
2832
+ { startIndex: 54, type: 'variable.predefined.wgsl' },
2833
+ { startIndex: 61, type: 'white.wgsl' },
2834
+ { startIndex: 62, type: 'variable.predefined.wgsl' },
2835
+ { startIndex: 69, type: 'white.wgsl' },
2836
+ { startIndex: 70, type: 'variable.predefined.wgsl' }
2837
+ ]
2838
+ },
2839
+ {
2840
+ line: 'reverseBits round saturate sign sin sinh smoothstep sqrt step tan tanh transpose',
2841
+ tokens: [
2842
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2843
+ { startIndex: 11, type: 'white.wgsl' },
2844
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
2845
+ { startIndex: 17, type: 'white.wgsl' },
2846
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
2847
+ { startIndex: 26, type: 'white.wgsl' },
2848
+ { startIndex: 27, type: 'variable.predefined.wgsl' },
2849
+ { startIndex: 31, type: 'white.wgsl' },
2850
+ { startIndex: 32, type: 'variable.predefined.wgsl' },
2851
+ { startIndex: 35, type: 'white.wgsl' },
2852
+ { startIndex: 36, type: 'variable.predefined.wgsl' },
2853
+ { startIndex: 40, type: 'white.wgsl' },
2854
+ { startIndex: 41, type: 'variable.predefined.wgsl' },
2855
+ { startIndex: 51, type: 'white.wgsl' },
2856
+ { startIndex: 52, type: 'variable.predefined.wgsl' },
2857
+ { startIndex: 56, type: 'white.wgsl' },
2858
+ { startIndex: 57, type: 'variable.predefined.wgsl' },
2859
+ { startIndex: 61, type: 'white.wgsl' },
2860
+ { startIndex: 62, type: 'variable.predefined.wgsl' },
2861
+ { startIndex: 65, type: 'white.wgsl' },
2862
+ { startIndex: 66, type: 'variable.predefined.wgsl' },
2863
+ { startIndex: 70, type: 'white.wgsl' },
2864
+ { startIndex: 71, type: 'variable.predefined.wgsl' }
2865
+ ]
2866
+ },
2867
+ {
2868
+ line: 'trunc dpdx dpdxCoarse dpdxFine dpdy dpdyCoarse dpdyFine fwidth fwidthCoarse fwidthFine',
2869
+ tokens: [
2870
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2871
+ { startIndex: 5, type: 'white.wgsl' },
2872
+ { startIndex: 6, type: 'variable.predefined.wgsl' },
2873
+ { startIndex: 10, type: 'white.wgsl' },
2874
+ { startIndex: 11, type: 'variable.predefined.wgsl' },
2875
+ { startIndex: 21, type: 'white.wgsl' },
2876
+ { startIndex: 22, type: 'variable.predefined.wgsl' },
2877
+ { startIndex: 30, type: 'white.wgsl' },
2878
+ { startIndex: 31, type: 'variable.predefined.wgsl' },
2879
+ { startIndex: 35, type: 'white.wgsl' },
2880
+ { startIndex: 36, type: 'variable.predefined.wgsl' },
2881
+ { startIndex: 46, type: 'white.wgsl' },
2882
+ { startIndex: 47, type: 'variable.predefined.wgsl' },
2883
+ { startIndex: 55, type: 'white.wgsl' },
2884
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
2885
+ { startIndex: 62, type: 'white.wgsl' },
2886
+ { startIndex: 63, type: 'variable.predefined.wgsl' },
2887
+ { startIndex: 75, type: 'white.wgsl' },
2888
+ { startIndex: 76, type: 'variable.predefined.wgsl' }
2889
+ ]
2890
+ },
2891
+ {
2892
+ line: 'textureDimensions textureGather textureGatherCompare textureLoad textureNumLayers',
2893
+ tokens: [
2894
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2895
+ { startIndex: 17, type: 'white.wgsl' },
2896
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
2897
+ { startIndex: 31, type: 'white.wgsl' },
2898
+ { startIndex: 32, type: 'variable.predefined.wgsl' },
2899
+ { startIndex: 52, type: 'white.wgsl' },
2900
+ { startIndex: 53, type: 'variable.predefined.wgsl' },
2901
+ { startIndex: 64, type: 'white.wgsl' },
2902
+ { startIndex: 65, type: 'variable.predefined.wgsl' }
2903
+ ]
2904
+ },
2905
+ {
2906
+ line: 'textureNumLevels textureNumSamples textureSample textureSampleBias textureSampleCompare',
2907
+ tokens: [
2908
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2909
+ { startIndex: 16, type: 'white.wgsl' },
2910
+ { startIndex: 17, type: 'variable.predefined.wgsl' },
2911
+ { startIndex: 34, type: 'white.wgsl' },
2912
+ { startIndex: 35, type: 'variable.predefined.wgsl' },
2913
+ { startIndex: 48, type: 'white.wgsl' },
2914
+ { startIndex: 49, type: 'variable.predefined.wgsl' },
2915
+ { startIndex: 66, type: 'white.wgsl' },
2916
+ { startIndex: 67, type: 'variable.predefined.wgsl' }
2917
+ ]
2918
+ },
2919
+ {
2920
+ line: 'textureSampleCompareLevel textureSampleGrad textureSampleLevel textureSampleBaseClampToEdge',
2921
+ tokens: [
2922
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2923
+ { startIndex: 25, type: 'white.wgsl' },
2924
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
2925
+ { startIndex: 43, type: 'white.wgsl' },
2926
+ { startIndex: 44, type: 'variable.predefined.wgsl' },
2927
+ { startIndex: 62, type: 'white.wgsl' },
2928
+ { startIndex: 63, type: 'variable.predefined.wgsl' }
2929
+ ]
2930
+ },
2931
+ {
2932
+ line: 'textureStore atomicLoad atomicStore atomicAdd atomicSub atomicMax atomicMin',
2933
+ tokens: [
2934
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2935
+ { startIndex: 12, type: 'white.wgsl' },
2936
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
2937
+ { startIndex: 23, type: 'white.wgsl' },
2938
+ { startIndex: 24, type: 'variable.predefined.wgsl' },
2939
+ { startIndex: 35, type: 'white.wgsl' },
2940
+ { startIndex: 36, type: 'variable.predefined.wgsl' },
2941
+ { startIndex: 45, type: 'white.wgsl' },
2942
+ { startIndex: 46, type: 'variable.predefined.wgsl' },
2943
+ { startIndex: 55, type: 'white.wgsl' },
2944
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
2945
+ { startIndex: 65, type: 'white.wgsl' },
2946
+ { startIndex: 66, type: 'variable.predefined.wgsl' }
2947
+ ]
2948
+ },
2949
+ {
2950
+ line: 'atomicAnd atomicOr atomicXor atomicExchange atomicCompareExchangeWeak pack4x8snorm',
2951
+ tokens: [
2952
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2953
+ { startIndex: 9, type: 'white.wgsl' },
2954
+ { startIndex: 10, type: 'variable.predefined.wgsl' },
2955
+ { startIndex: 18, type: 'white.wgsl' },
2956
+ { startIndex: 19, type: 'variable.predefined.wgsl' },
2957
+ { startIndex: 28, type: 'white.wgsl' },
2958
+ { startIndex: 29, type: 'variable.predefined.wgsl' },
2959
+ { startIndex: 43, type: 'white.wgsl' },
2960
+ { startIndex: 44, type: 'variable.predefined.wgsl' },
2961
+ { startIndex: 69, type: 'white.wgsl' },
2962
+ { startIndex: 70, type: 'variable.predefined.wgsl' }
2963
+ ]
2964
+ },
2965
+ {
2966
+ line: 'pack4x8unorm pack2x16snorm pack2x16unorm pack2x16float unpack4x8snorm unpack4x8unorm',
2967
+ tokens: [
2968
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2969
+ { startIndex: 12, type: 'white.wgsl' },
2970
+ { startIndex: 13, type: 'variable.predefined.wgsl' },
2971
+ { startIndex: 26, type: 'white.wgsl' },
2972
+ { startIndex: 27, type: 'variable.predefined.wgsl' },
2973
+ { startIndex: 40, type: 'white.wgsl' },
2974
+ { startIndex: 41, type: 'variable.predefined.wgsl' },
2975
+ { startIndex: 54, type: 'white.wgsl' },
2976
+ { startIndex: 55, type: 'variable.predefined.wgsl' },
2977
+ { startIndex: 69, type: 'white.wgsl' },
2978
+ { startIndex: 70, type: 'variable.predefined.wgsl' }
2979
+ ]
2980
+ },
2981
+ {
2982
+ line: 'unpack2x16snorm unpack2x16unorm unpack2x16float storageBarrier workgroupBarrier',
2983
+ tokens: [
2984
+ { startIndex: 0, type: 'variable.predefined.wgsl' },
2985
+ { startIndex: 15, type: 'white.wgsl' },
2986
+ { startIndex: 16, type: 'variable.predefined.wgsl' },
2987
+ { startIndex: 31, type: 'white.wgsl' },
2988
+ { startIndex: 32, type: 'variable.predefined.wgsl' },
2989
+ { startIndex: 47, type: 'white.wgsl' },
2990
+ { startIndex: 48, type: 'variable.predefined.wgsl' },
2991
+ { startIndex: 62, type: 'white.wgsl' },
2992
+ { startIndex: 63, type: 'variable.predefined.wgsl' }
2993
+ ]
2994
+ },
2995
+ {
2996
+ line: 'workgroupUniformLoad',
2997
+ tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }]
2998
+ }
2999
+ ],
3000
+ // reserved
3001
+ [
3002
+ { line: 'NULL', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3003
+ { line: 'Self', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3004
+ { line: 'abstract', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3005
+ { line: 'active', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3006
+ { line: 'alignas', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3007
+ { line: 'alignof', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3008
+ { line: 'as', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3009
+ { line: 'asm', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3010
+ { line: 'asm_fragment', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3011
+ { line: 'async', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3012
+ { line: 'attribute', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3013
+ { line: 'auto', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3014
+ { line: 'await', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3015
+ { line: 'become', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3016
+ { line: 'binding_array', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3017
+ { line: 'cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3018
+ { line: 'catch', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3019
+ { line: 'class', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3020
+ { line: 'co_await', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3021
+ { line: 'co_return', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3022
+ { line: 'co_yield', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3023
+ { line: 'coherent', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3024
+ { line: 'column_major', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3025
+ { line: 'common', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3026
+ { line: 'compile', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3027
+ { line: 'compile_fragment', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3028
+ { line: 'concept', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3029
+ { line: 'const_cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3030
+ { line: 'consteval', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3031
+ { line: 'constexpr', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3032
+ { line: 'constinit', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3033
+ { line: 'crate', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3034
+ { line: 'debugger', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3035
+ { line: 'decltype', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3036
+ { line: 'delete', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3037
+ { line: 'demote', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3038
+ { line: 'demote_to_helper', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3039
+ { line: 'do', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3040
+ { line: 'dynamic_cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3041
+ { line: 'enum', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3042
+ { line: 'explicit', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3043
+ { line: 'export', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3044
+ { line: 'extends', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3045
+ { line: 'extern', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3046
+ { line: 'external', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3047
+ { line: 'fallthrough', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3048
+ { line: 'filter', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3049
+ { line: 'final', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3050
+ { line: 'finally', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3051
+ { line: 'friend', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3052
+ { line: 'from', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3053
+ { line: 'fxgroup', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3054
+ { line: 'get', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3055
+ { line: 'goto', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3056
+ { line: 'groupshared', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3057
+ { line: 'highp', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3058
+ { line: 'impl', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3059
+ { line: 'implements', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3060
+ { line: 'import', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3061
+ { line: 'inline', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3062
+ { line: 'instanceof', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3063
+ { line: 'interface', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3064
+ { line: 'layout', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3065
+ { line: 'lowp', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3066
+ { line: 'macro', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3067
+ { line: 'macro_rules', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3068
+ { line: 'match', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3069
+ { line: 'mediump', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3070
+ { line: 'meta', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3071
+ { line: 'mod', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3072
+ { line: 'module', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3073
+ { line: 'move', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3074
+ { line: 'mut', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3075
+ { line: 'mutable', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3076
+ { line: 'namespace', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3077
+ { line: 'new', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3078
+ { line: 'nil', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3079
+ { line: 'noexcept', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3080
+ { line: 'noinline', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3081
+ { line: 'nointerpolation', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3082
+ { line: 'noperspective', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3083
+ { line: 'null', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3084
+ { line: 'nullptr', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3085
+ { line: 'of', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3086
+ { line: 'operator', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3087
+ { line: 'package', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3088
+ { line: 'packoffset', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3089
+ { line: 'partition', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3090
+ { line: 'pass', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3091
+ { line: 'patch', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3092
+ { line: 'pixelfragment', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3093
+ { line: 'precise', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3094
+ { line: 'precision', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3095
+ { line: 'premerge', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3096
+ { line: 'priv', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3097
+ { line: 'protected', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3098
+ { line: 'pub', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3099
+ { line: 'public', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3100
+ { line: 'readonly', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3101
+ { line: 'ref', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3102
+ { line: 'regardless', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3103
+ { line: 'register', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3104
+ { line: 'reinterpret_cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3105
+ { line: 'require', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3106
+ { line: 'resource', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3107
+ { line: 'restrict', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3108
+ { line: 'self', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3109
+ { line: 'set', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3110
+ { line: 'shared', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3111
+ { line: 'sizeof', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3112
+ { line: 'smooth', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3113
+ { line: 'snorm', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3114
+ { line: 'static', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3115
+ { line: 'static_assert', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3116
+ { line: 'static_cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3117
+ { line: 'std', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3118
+ { line: 'subroutine', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3119
+ { line: 'super', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3120
+ { line: 'target', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3121
+ { line: 'template', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3122
+ { line: 'this', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3123
+ { line: 'thread_local', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3124
+ { line: 'throw', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3125
+ { line: 'trait', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3126
+ { line: 'try', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3127
+ { line: 'type', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3128
+ { line: 'typedef', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3129
+ { line: 'typeid', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3130
+ { line: 'typename', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3131
+ { line: 'typeof', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3132
+ { line: 'union', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3133
+ { line: 'unless', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3134
+ { line: 'unorm', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3135
+ { line: 'unsafe', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3136
+ { line: 'unsized', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3137
+ { line: 'use', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3138
+ { line: 'using', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3139
+ { line: 'varying', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3140
+ { line: 'virtual', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3141
+ { line: 'volatile', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3142
+ { line: 'wgsl', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3143
+ { line: 'where', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3144
+ { line: 'with', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3145
+ { line: 'writeonly', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] },
3146
+ { line: 'yield', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }
3147
+ ],
3148
+ // sampled texture
3149
+ [
3150
+ {
3151
+ line: '@group(0) @binding(0) var texture_1d<f32>;',
3152
+ tokens: [
3153
+ { startIndex: 0, type: 'annotation.wgsl' },
3154
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3155
+ { startIndex: 7, type: 'number.wgsl' },
3156
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3157
+ { startIndex: 9, type: 'white.wgsl' },
3158
+ { startIndex: 10, type: 'annotation.wgsl' },
3159
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3160
+ { startIndex: 19, type: 'number.wgsl' },
3161
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3162
+ { startIndex: 21, type: 'white.wgsl' },
3163
+ { startIndex: 22, type: 'keyword.wgsl' },
3164
+ { startIndex: 25, type: 'white.wgsl' },
3165
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3166
+ { startIndex: 36, type: 'operator.wgsl' },
3167
+ { startIndex: 37, type: 'variable.predefined.wgsl' },
3168
+ { startIndex: 40, type: 'delimiter.wgsl' }
3169
+ ]
3170
+ },
3171
+ {
3172
+ line: '@group(0) @binding(1) var texture_2d<f32>;',
3173
+ tokens: [
3174
+ { startIndex: 0, type: 'annotation.wgsl' },
3175
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3176
+ { startIndex: 7, type: 'number.wgsl' },
3177
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3178
+ { startIndex: 9, type: 'white.wgsl' },
3179
+ { startIndex: 10, type: 'annotation.wgsl' },
3180
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3181
+ { startIndex: 19, type: 'number.wgsl' },
3182
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3183
+ { startIndex: 21, type: 'white.wgsl' },
3184
+ { startIndex: 22, type: 'keyword.wgsl' },
3185
+ { startIndex: 25, type: 'white.wgsl' },
3186
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3187
+ { startIndex: 36, type: 'operator.wgsl' },
3188
+ { startIndex: 37, type: 'variable.predefined.wgsl' },
3189
+ { startIndex: 40, type: 'delimiter.wgsl' }
3190
+ ]
3191
+ },
3192
+ {
3193
+ line: '@group(0) @binding(2) var texture_2d_array<f32>;',
3194
+ tokens: [
3195
+ { startIndex: 0, type: 'annotation.wgsl' },
3196
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3197
+ { startIndex: 7, type: 'number.wgsl' },
3198
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3199
+ { startIndex: 9, type: 'white.wgsl' },
3200
+ { startIndex: 10, type: 'annotation.wgsl' },
3201
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3202
+ { startIndex: 19, type: 'number.wgsl' },
3203
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3204
+ { startIndex: 21, type: 'white.wgsl' },
3205
+ { startIndex: 22, type: 'keyword.wgsl' },
3206
+ { startIndex: 25, type: 'white.wgsl' },
3207
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3208
+ { startIndex: 42, type: 'operator.wgsl' },
3209
+ { startIndex: 43, type: 'variable.predefined.wgsl' },
3210
+ { startIndex: 46, type: 'delimiter.wgsl' }
3211
+ ]
3212
+ },
3213
+ {
3214
+ line: '@group(0) @binding(3) var texture_3d<f32>;',
3215
+ tokens: [
3216
+ { startIndex: 0, type: 'annotation.wgsl' },
3217
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3218
+ { startIndex: 7, type: 'number.wgsl' },
3219
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3220
+ { startIndex: 9, type: 'white.wgsl' },
3221
+ { startIndex: 10, type: 'annotation.wgsl' },
3222
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3223
+ { startIndex: 19, type: 'number.wgsl' },
3224
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3225
+ { startIndex: 21, type: 'white.wgsl' },
3226
+ { startIndex: 22, type: 'keyword.wgsl' },
3227
+ { startIndex: 25, type: 'white.wgsl' },
3228
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3229
+ { startIndex: 36, type: 'operator.wgsl' },
3230
+ { startIndex: 37, type: 'variable.predefined.wgsl' },
3231
+ { startIndex: 40, type: 'delimiter.wgsl' }
3232
+ ]
3233
+ },
3234
+ {
3235
+ line: '@group(0) @binding(4) var texture_cube<f32>;',
3236
+ tokens: [
3237
+ { startIndex: 0, type: 'annotation.wgsl' },
3238
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3239
+ { startIndex: 7, type: 'number.wgsl' },
3240
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3241
+ { startIndex: 9, type: 'white.wgsl' },
3242
+ { startIndex: 10, type: 'annotation.wgsl' },
3243
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3244
+ { startIndex: 19, type: 'number.wgsl' },
3245
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3246
+ { startIndex: 21, type: 'white.wgsl' },
3247
+ { startIndex: 22, type: 'keyword.wgsl' },
3248
+ { startIndex: 25, type: 'white.wgsl' },
3249
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3250
+ { startIndex: 38, type: 'operator.wgsl' },
3251
+ { startIndex: 39, type: 'variable.predefined.wgsl' },
3252
+ { startIndex: 42, type: 'delimiter.wgsl' }
3253
+ ]
3254
+ },
3255
+ {
3256
+ line: '@group(0) @binding(5) var texture_cube_array<f32>;',
3257
+ tokens: [
3258
+ { startIndex: 0, type: 'annotation.wgsl' },
3259
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3260
+ { startIndex: 7, type: 'number.wgsl' },
3261
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3262
+ { startIndex: 9, type: 'white.wgsl' },
3263
+ { startIndex: 10, type: 'annotation.wgsl' },
3264
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3265
+ { startIndex: 19, type: 'number.wgsl' },
3266
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3267
+ { startIndex: 21, type: 'white.wgsl' },
3268
+ { startIndex: 22, type: 'keyword.wgsl' },
3269
+ { startIndex: 25, type: 'white.wgsl' },
3270
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3271
+ { startIndex: 44, type: 'operator.wgsl' },
3272
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3273
+ { startIndex: 48, type: 'delimiter.wgsl' }
3274
+ ]
3275
+ }
3276
+ ],
3277
+ // storage texture
3278
+ [
3279
+ {
3280
+ line: '@group(0) @binding(0) var texture_storage_1d<rgba8unorm,write>;',
3281
+ tokens: [
3282
+ { startIndex: 0, type: 'annotation.wgsl' },
3283
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3284
+ { startIndex: 7, type: 'number.wgsl' },
3285
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3286
+ { startIndex: 9, type: 'white.wgsl' },
3287
+ { startIndex: 10, type: 'annotation.wgsl' },
3288
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3289
+ { startIndex: 19, type: 'number.wgsl' },
3290
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3291
+ { startIndex: 21, type: 'white.wgsl' },
3292
+ { startIndex: 22, type: 'keyword.wgsl' },
3293
+ { startIndex: 25, type: 'white.wgsl' },
3294
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3295
+ { startIndex: 44, type: 'operator.wgsl' },
3296
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3297
+ { startIndex: 55, type: 'delimiter.wgsl' },
3298
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3299
+ { startIndex: 61, type: 'delimiter.wgsl' }
3300
+ ]
3301
+ },
3302
+ {
3303
+ line: '@group(0) @binding(1) var texture_storage_2d<rgba8unorm,write>;',
3304
+ tokens: [
3305
+ { startIndex: 0, type: 'annotation.wgsl' },
3306
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3307
+ { startIndex: 7, type: 'number.wgsl' },
3308
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3309
+ { startIndex: 9, type: 'white.wgsl' },
3310
+ { startIndex: 10, type: 'annotation.wgsl' },
3311
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3312
+ { startIndex: 19, type: 'number.wgsl' },
3313
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3314
+ { startIndex: 21, type: 'white.wgsl' },
3315
+ { startIndex: 22, type: 'keyword.wgsl' },
3316
+ { startIndex: 25, type: 'white.wgsl' },
3317
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3318
+ { startIndex: 44, type: 'operator.wgsl' },
3319
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3320
+ { startIndex: 55, type: 'delimiter.wgsl' },
3321
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3322
+ { startIndex: 61, type: 'delimiter.wgsl' }
3323
+ ]
3324
+ },
3325
+ {
3326
+ line: '@group(0) @binding(2) var texture_storage_2d_array<rgba8unorm,write>;',
3327
+ tokens: [
3328
+ { startIndex: 0, type: 'annotation.wgsl' },
3329
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3330
+ { startIndex: 7, type: 'number.wgsl' },
3331
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3332
+ { startIndex: 9, type: 'white.wgsl' },
3333
+ { startIndex: 10, type: 'annotation.wgsl' },
3334
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3335
+ { startIndex: 19, type: 'number.wgsl' },
3336
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3337
+ { startIndex: 21, type: 'white.wgsl' },
3338
+ { startIndex: 22, type: 'keyword.wgsl' },
3339
+ { startIndex: 25, type: 'white.wgsl' },
3340
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3341
+ { startIndex: 50, type: 'operator.wgsl' },
3342
+ { startIndex: 51, type: 'variable.predefined.wgsl' },
3343
+ { startIndex: 61, type: 'delimiter.wgsl' },
3344
+ { startIndex: 62, type: 'variable.predefined.wgsl' },
3345
+ { startIndex: 67, type: 'delimiter.wgsl' }
3346
+ ]
3347
+ },
3348
+ {
3349
+ line: '@group(0) @binding(3) var texture_storage_3d<rgba8unorm,write>;',
3350
+ tokens: [
3351
+ { startIndex: 0, type: 'annotation.wgsl' },
3352
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3353
+ { startIndex: 7, type: 'number.wgsl' },
3354
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3355
+ { startIndex: 9, type: 'white.wgsl' },
3356
+ { startIndex: 10, type: 'annotation.wgsl' },
3357
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3358
+ { startIndex: 19, type: 'number.wgsl' },
3359
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3360
+ { startIndex: 21, type: 'white.wgsl' },
3361
+ { startIndex: 22, type: 'keyword.wgsl' },
3362
+ { startIndex: 25, type: 'white.wgsl' },
3363
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3364
+ { startIndex: 44, type: 'operator.wgsl' },
3365
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3366
+ { startIndex: 55, type: 'delimiter.wgsl' },
3367
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3368
+ { startIndex: 61, type: 'delimiter.wgsl' }
3369
+ ]
3370
+ }
3371
+ ],
3372
+ // texel formats
3373
+ [
3374
+ {
3375
+ line: '@group(0) @binding(0) var texture_storage_2d<rgba8unorm,write>;',
3376
+ tokens: [
3377
+ { startIndex: 0, type: 'annotation.wgsl' },
3378
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3379
+ { startIndex: 7, type: 'number.wgsl' },
3380
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3381
+ { startIndex: 9, type: 'white.wgsl' },
3382
+ { startIndex: 10, type: 'annotation.wgsl' },
3383
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3384
+ { startIndex: 19, type: 'number.wgsl' },
3385
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3386
+ { startIndex: 21, type: 'white.wgsl' },
3387
+ { startIndex: 22, type: 'keyword.wgsl' },
3388
+ { startIndex: 25, type: 'white.wgsl' },
3389
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3390
+ { startIndex: 44, type: 'operator.wgsl' },
3391
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3392
+ { startIndex: 55, type: 'delimiter.wgsl' },
3393
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3394
+ { startIndex: 61, type: 'delimiter.wgsl' }
3395
+ ]
3396
+ },
3397
+ {
3398
+ line: '@group(0) @binding(1) var texture_storage_2d<rgba8snorm,write>;',
3399
+ tokens: [
3400
+ { startIndex: 0, type: 'annotation.wgsl' },
3401
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3402
+ { startIndex: 7, type: 'number.wgsl' },
3403
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3404
+ { startIndex: 9, type: 'white.wgsl' },
3405
+ { startIndex: 10, type: 'annotation.wgsl' },
3406
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3407
+ { startIndex: 19, type: 'number.wgsl' },
3408
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3409
+ { startIndex: 21, type: 'white.wgsl' },
3410
+ { startIndex: 22, type: 'keyword.wgsl' },
3411
+ { startIndex: 25, type: 'white.wgsl' },
3412
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3413
+ { startIndex: 44, type: 'operator.wgsl' },
3414
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3415
+ { startIndex: 55, type: 'delimiter.wgsl' },
3416
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3417
+ { startIndex: 61, type: 'delimiter.wgsl' }
3418
+ ]
3419
+ },
3420
+ {
3421
+ line: '@group(0) @binding(2) var texture_storage_2d<rgba8uint,write>;',
3422
+ tokens: [
3423
+ { startIndex: 0, type: 'annotation.wgsl' },
3424
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3425
+ { startIndex: 7, type: 'number.wgsl' },
3426
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3427
+ { startIndex: 9, type: 'white.wgsl' },
3428
+ { startIndex: 10, type: 'annotation.wgsl' },
3429
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3430
+ { startIndex: 19, type: 'number.wgsl' },
3431
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3432
+ { startIndex: 21, type: 'white.wgsl' },
3433
+ { startIndex: 22, type: 'keyword.wgsl' },
3434
+ { startIndex: 25, type: 'white.wgsl' },
3435
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3436
+ { startIndex: 44, type: 'operator.wgsl' },
3437
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3438
+ { startIndex: 54, type: 'delimiter.wgsl' },
3439
+ { startIndex: 55, type: 'variable.predefined.wgsl' },
3440
+ { startIndex: 60, type: 'delimiter.wgsl' }
3441
+ ]
3442
+ },
3443
+ {
3444
+ line: '@group(0) @binding(3) var texture_storage_2d<rgba8sint,write>;',
3445
+ tokens: [
3446
+ { startIndex: 0, type: 'annotation.wgsl' },
3447
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3448
+ { startIndex: 7, type: 'number.wgsl' },
3449
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3450
+ { startIndex: 9, type: 'white.wgsl' },
3451
+ { startIndex: 10, type: 'annotation.wgsl' },
3452
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3453
+ { startIndex: 19, type: 'number.wgsl' },
3454
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3455
+ { startIndex: 21, type: 'white.wgsl' },
3456
+ { startIndex: 22, type: 'keyword.wgsl' },
3457
+ { startIndex: 25, type: 'white.wgsl' },
3458
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3459
+ { startIndex: 44, type: 'operator.wgsl' },
3460
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3461
+ { startIndex: 54, type: 'delimiter.wgsl' },
3462
+ { startIndex: 55, type: 'variable.predefined.wgsl' },
3463
+ { startIndex: 60, type: 'delimiter.wgsl' }
3464
+ ]
3465
+ },
3466
+ {
3467
+ line: '@group(0) @binding(4) var texture_storage_2d<rgba16uint,write>;',
3468
+ tokens: [
3469
+ { startIndex: 0, type: 'annotation.wgsl' },
3470
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3471
+ { startIndex: 7, type: 'number.wgsl' },
3472
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3473
+ { startIndex: 9, type: 'white.wgsl' },
3474
+ { startIndex: 10, type: 'annotation.wgsl' },
3475
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3476
+ { startIndex: 19, type: 'number.wgsl' },
3477
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3478
+ { startIndex: 21, type: 'white.wgsl' },
3479
+ { startIndex: 22, type: 'keyword.wgsl' },
3480
+ { startIndex: 25, type: 'white.wgsl' },
3481
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3482
+ { startIndex: 44, type: 'operator.wgsl' },
3483
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3484
+ { startIndex: 55, type: 'delimiter.wgsl' },
3485
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3486
+ { startIndex: 61, type: 'delimiter.wgsl' }
3487
+ ]
3488
+ },
3489
+ {
3490
+ line: '@group(0) @binding(5) var texture_storage_2d<rgba16sint,write>;',
3491
+ tokens: [
3492
+ { startIndex: 0, type: 'annotation.wgsl' },
3493
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3494
+ { startIndex: 7, type: 'number.wgsl' },
3495
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3496
+ { startIndex: 9, type: 'white.wgsl' },
3497
+ { startIndex: 10, type: 'annotation.wgsl' },
3498
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3499
+ { startIndex: 19, type: 'number.wgsl' },
3500
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3501
+ { startIndex: 21, type: 'white.wgsl' },
3502
+ { startIndex: 22, type: 'keyword.wgsl' },
3503
+ { startIndex: 25, type: 'white.wgsl' },
3504
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3505
+ { startIndex: 44, type: 'operator.wgsl' },
3506
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3507
+ { startIndex: 55, type: 'delimiter.wgsl' },
3508
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3509
+ { startIndex: 61, type: 'delimiter.wgsl' }
3510
+ ]
3511
+ },
3512
+ {
3513
+ line: '@group(0) @binding(6) var texture_storage_2d<rgba16float,write>;',
3514
+ tokens: [
3515
+ { startIndex: 0, type: 'annotation.wgsl' },
3516
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3517
+ { startIndex: 7, type: 'number.wgsl' },
3518
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3519
+ { startIndex: 9, type: 'white.wgsl' },
3520
+ { startIndex: 10, type: 'annotation.wgsl' },
3521
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3522
+ { startIndex: 19, type: 'number.wgsl' },
3523
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3524
+ { startIndex: 21, type: 'white.wgsl' },
3525
+ { startIndex: 22, type: 'keyword.wgsl' },
3526
+ { startIndex: 25, type: 'white.wgsl' },
3527
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3528
+ { startIndex: 44, type: 'operator.wgsl' },
3529
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3530
+ { startIndex: 56, type: 'delimiter.wgsl' },
3531
+ { startIndex: 57, type: 'variable.predefined.wgsl' },
3532
+ { startIndex: 62, type: 'delimiter.wgsl' }
3533
+ ]
3534
+ },
3535
+ {
3536
+ line: '@group(0) @binding(7) var texture_storage_2d<r32uint,write>;',
3537
+ tokens: [
3538
+ { startIndex: 0, type: 'annotation.wgsl' },
3539
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3540
+ { startIndex: 7, type: 'number.wgsl' },
3541
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3542
+ { startIndex: 9, type: 'white.wgsl' },
3543
+ { startIndex: 10, type: 'annotation.wgsl' },
3544
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3545
+ { startIndex: 19, type: 'number.wgsl' },
3546
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3547
+ { startIndex: 21, type: 'white.wgsl' },
3548
+ { startIndex: 22, type: 'keyword.wgsl' },
3549
+ { startIndex: 25, type: 'white.wgsl' },
3550
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3551
+ { startIndex: 44, type: 'operator.wgsl' },
3552
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3553
+ { startIndex: 52, type: 'delimiter.wgsl' },
3554
+ { startIndex: 53, type: 'variable.predefined.wgsl' },
3555
+ { startIndex: 58, type: 'delimiter.wgsl' }
3556
+ ]
3557
+ },
3558
+ {
3559
+ line: '@group(0) @binding(8) var texture_storage_2d<r32sint,write>;',
3560
+ tokens: [
3561
+ { startIndex: 0, type: 'annotation.wgsl' },
3562
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3563
+ { startIndex: 7, type: 'number.wgsl' },
3564
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3565
+ { startIndex: 9, type: 'white.wgsl' },
3566
+ { startIndex: 10, type: 'annotation.wgsl' },
3567
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3568
+ { startIndex: 19, type: 'number.wgsl' },
3569
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3570
+ { startIndex: 21, type: 'white.wgsl' },
3571
+ { startIndex: 22, type: 'keyword.wgsl' },
3572
+ { startIndex: 25, type: 'white.wgsl' },
3573
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3574
+ { startIndex: 44, type: 'operator.wgsl' },
3575
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3576
+ { startIndex: 52, type: 'delimiter.wgsl' },
3577
+ { startIndex: 53, type: 'variable.predefined.wgsl' },
3578
+ { startIndex: 58, type: 'delimiter.wgsl' }
3579
+ ]
3580
+ },
3581
+ {
3582
+ line: '@group(0) @binding(9) var texture_storage_2d<r32float,write>;',
3583
+ tokens: [
3584
+ { startIndex: 0, type: 'annotation.wgsl' },
3585
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3586
+ { startIndex: 7, type: 'number.wgsl' },
3587
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3588
+ { startIndex: 9, type: 'white.wgsl' },
3589
+ { startIndex: 10, type: 'annotation.wgsl' },
3590
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3591
+ { startIndex: 19, type: 'number.wgsl' },
3592
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3593
+ { startIndex: 21, type: 'white.wgsl' },
3594
+ { startIndex: 22, type: 'keyword.wgsl' },
3595
+ { startIndex: 25, type: 'white.wgsl' },
3596
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3597
+ { startIndex: 44, type: 'operator.wgsl' },
3598
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3599
+ { startIndex: 53, type: 'delimiter.wgsl' },
3600
+ { startIndex: 54, type: 'variable.predefined.wgsl' },
3601
+ { startIndex: 59, type: 'delimiter.wgsl' }
3602
+ ]
3603
+ },
3604
+ {
3605
+ line: '@group(1) @binding(0) var texture_storage_2d<rg32uint,write>;',
3606
+ tokens: [
3607
+ { startIndex: 0, type: 'annotation.wgsl' },
3608
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3609
+ { startIndex: 7, type: 'number.wgsl' },
3610
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3611
+ { startIndex: 9, type: 'white.wgsl' },
3612
+ { startIndex: 10, type: 'annotation.wgsl' },
3613
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3614
+ { startIndex: 19, type: 'number.wgsl' },
3615
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3616
+ { startIndex: 21, type: 'white.wgsl' },
3617
+ { startIndex: 22, type: 'keyword.wgsl' },
3618
+ { startIndex: 25, type: 'white.wgsl' },
3619
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3620
+ { startIndex: 44, type: 'operator.wgsl' },
3621
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3622
+ { startIndex: 53, type: 'delimiter.wgsl' },
3623
+ { startIndex: 54, type: 'variable.predefined.wgsl' },
3624
+ { startIndex: 59, type: 'delimiter.wgsl' }
3625
+ ]
3626
+ },
3627
+ {
3628
+ line: '@group(1) @binding(1) var texture_storage_2d<rg32sint,write>;',
3629
+ tokens: [
3630
+ { startIndex: 0, type: 'annotation.wgsl' },
3631
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3632
+ { startIndex: 7, type: 'number.wgsl' },
3633
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3634
+ { startIndex: 9, type: 'white.wgsl' },
3635
+ { startIndex: 10, type: 'annotation.wgsl' },
3636
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3637
+ { startIndex: 19, type: 'number.wgsl' },
3638
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3639
+ { startIndex: 21, type: 'white.wgsl' },
3640
+ { startIndex: 22, type: 'keyword.wgsl' },
3641
+ { startIndex: 25, type: 'white.wgsl' },
3642
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3643
+ { startIndex: 44, type: 'operator.wgsl' },
3644
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3645
+ { startIndex: 53, type: 'delimiter.wgsl' },
3646
+ { startIndex: 54, type: 'variable.predefined.wgsl' },
3647
+ { startIndex: 59, type: 'delimiter.wgsl' }
3648
+ ]
3649
+ },
3650
+ {
3651
+ line: '@group(1) @binding(2) var texture_storage_2d<rg32float,write>;',
3652
+ tokens: [
3653
+ { startIndex: 0, type: 'annotation.wgsl' },
3654
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3655
+ { startIndex: 7, type: 'number.wgsl' },
3656
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3657
+ { startIndex: 9, type: 'white.wgsl' },
3658
+ { startIndex: 10, type: 'annotation.wgsl' },
3659
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3660
+ { startIndex: 19, type: 'number.wgsl' },
3661
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3662
+ { startIndex: 21, type: 'white.wgsl' },
3663
+ { startIndex: 22, type: 'keyword.wgsl' },
3664
+ { startIndex: 25, type: 'white.wgsl' },
3665
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3666
+ { startIndex: 44, type: 'operator.wgsl' },
3667
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3668
+ { startIndex: 54, type: 'delimiter.wgsl' },
3669
+ { startIndex: 55, type: 'variable.predefined.wgsl' },
3670
+ { startIndex: 60, type: 'delimiter.wgsl' }
3671
+ ]
3672
+ },
3673
+ {
3674
+ line: '@group(1) @binding(3) var texture_storage_2d<rgba32uint,write>;',
3675
+ tokens: [
3676
+ { startIndex: 0, type: 'annotation.wgsl' },
3677
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3678
+ { startIndex: 7, type: 'number.wgsl' },
3679
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3680
+ { startIndex: 9, type: 'white.wgsl' },
3681
+ { startIndex: 10, type: 'annotation.wgsl' },
3682
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3683
+ { startIndex: 19, type: 'number.wgsl' },
3684
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3685
+ { startIndex: 21, type: 'white.wgsl' },
3686
+ { startIndex: 22, type: 'keyword.wgsl' },
3687
+ { startIndex: 25, type: 'white.wgsl' },
3688
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3689
+ { startIndex: 44, type: 'operator.wgsl' },
3690
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3691
+ { startIndex: 55, type: 'delimiter.wgsl' },
3692
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3693
+ { startIndex: 61, type: 'delimiter.wgsl' }
3694
+ ]
3695
+ },
3696
+ {
3697
+ line: '@group(1) @binding(4) var texture_storage_2d<rgba32sint,write>;',
3698
+ tokens: [
3699
+ { startIndex: 0, type: 'annotation.wgsl' },
3700
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3701
+ { startIndex: 7, type: 'number.wgsl' },
3702
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3703
+ { startIndex: 9, type: 'white.wgsl' },
3704
+ { startIndex: 10, type: 'annotation.wgsl' },
3705
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3706
+ { startIndex: 19, type: 'number.wgsl' },
3707
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3708
+ { startIndex: 21, type: 'white.wgsl' },
3709
+ { startIndex: 22, type: 'keyword.wgsl' },
3710
+ { startIndex: 25, type: 'white.wgsl' },
3711
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3712
+ { startIndex: 44, type: 'operator.wgsl' },
3713
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3714
+ { startIndex: 55, type: 'delimiter.wgsl' },
3715
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3716
+ { startIndex: 61, type: 'delimiter.wgsl' }
3717
+ ]
3718
+ },
3719
+ {
3720
+ line: '@group(1) @binding(5) var texture_storage_2d<rgba32float,write>;',
3721
+ tokens: [
3722
+ { startIndex: 0, type: 'annotation.wgsl' },
3723
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3724
+ { startIndex: 7, type: 'number.wgsl' },
3725
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3726
+ { startIndex: 9, type: 'white.wgsl' },
3727
+ { startIndex: 10, type: 'annotation.wgsl' },
3728
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3729
+ { startIndex: 19, type: 'number.wgsl' },
3730
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3731
+ { startIndex: 21, type: 'white.wgsl' },
3732
+ { startIndex: 22, type: 'keyword.wgsl' },
3733
+ { startIndex: 25, type: 'white.wgsl' },
3734
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3735
+ { startIndex: 44, type: 'operator.wgsl' },
3736
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3737
+ { startIndex: 56, type: 'delimiter.wgsl' },
3738
+ { startIndex: 57, type: 'variable.predefined.wgsl' },
3739
+ { startIndex: 62, type: 'delimiter.wgsl' }
3740
+ ]
3741
+ },
3742
+ {
3743
+ line: '@group(1) @binding(6) var texture_storage_2d<bgra8unorm,write>;',
3744
+ tokens: [
3745
+ { startIndex: 0, type: 'annotation.wgsl' },
3746
+ { startIndex: 6, type: 'delimiter.parenthesis.wgsl' },
3747
+ { startIndex: 7, type: 'number.wgsl' },
3748
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3749
+ { startIndex: 9, type: 'white.wgsl' },
3750
+ { startIndex: 10, type: 'annotation.wgsl' },
3751
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3752
+ { startIndex: 19, type: 'number.wgsl' },
3753
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3754
+ { startIndex: 21, type: 'white.wgsl' },
3755
+ { startIndex: 22, type: 'keyword.wgsl' },
3756
+ { startIndex: 25, type: 'white.wgsl' },
3757
+ { startIndex: 26, type: 'variable.predefined.wgsl' },
3758
+ { startIndex: 44, type: 'operator.wgsl' },
3759
+ { startIndex: 45, type: 'variable.predefined.wgsl' },
3760
+ { startIndex: 55, type: 'delimiter.wgsl' },
3761
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3762
+ { startIndex: 61, type: 'delimiter.wgsl' }
3763
+ ]
3764
+ }
3765
+ ],
3766
+ // tiny render
3767
+ [
3768
+ { line: '@vertex', tokens: [{ startIndex: 0, type: 'annotation.wgsl' }] },
3769
+ {
3770
+ line: 'fn vmain(@location(0) v: vec4<f32>) -> @builtin(position) vec4f {',
3771
+ tokens: [
3772
+ { startIndex: 0, type: 'keyword.wgsl' },
3773
+ { startIndex: 2, type: 'white.wgsl' },
3774
+ { startIndex: 3, type: 'identifier.wgsl' },
3775
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3776
+ { startIndex: 9, type: 'annotation.wgsl' },
3777
+ { startIndex: 18, type: 'delimiter.parenthesis.wgsl' },
3778
+ { startIndex: 19, type: 'number.wgsl' },
3779
+ { startIndex: 20, type: 'delimiter.parenthesis.wgsl' },
3780
+ { startIndex: 21, type: 'white.wgsl' },
3781
+ { startIndex: 22, type: 'identifier.wgsl' },
3782
+ { startIndex: 23, type: 'delimiter.wgsl' },
3783
+ { startIndex: 24, type: 'white.wgsl' },
3784
+ { startIndex: 25, type: 'variable.predefined.wgsl' },
3785
+ { startIndex: 29, type: 'operator.wgsl' },
3786
+ { startIndex: 30, type: 'variable.predefined.wgsl' },
3787
+ { startIndex: 33, type: 'operator.wgsl' },
3788
+ { startIndex: 34, type: 'delimiter.parenthesis.wgsl' },
3789
+ { startIndex: 35, type: 'white.wgsl' },
3790
+ { startIndex: 36, type: 'operator.wgsl' },
3791
+ { startIndex: 38, type: 'white.wgsl' },
3792
+ { startIndex: 39, type: 'annotation.wgsl' },
3793
+ { startIndex: 47, type: 'delimiter.parenthesis.wgsl' },
3794
+ { startIndex: 48, type: 'variable.predefined.wgsl' },
3795
+ { startIndex: 56, type: 'delimiter.parenthesis.wgsl' },
3796
+ { startIndex: 57, type: 'white.wgsl' },
3797
+ { startIndex: 58, type: 'variable.predefined.wgsl' },
3798
+ { startIndex: 63, type: 'white.wgsl' },
3799
+ { startIndex: 64, type: 'delimiter.curly.wgsl' }
3800
+ ]
3801
+ },
3802
+ {
3803
+ line: ' return v;',
3804
+ tokens: [
3805
+ { startIndex: 0, type: 'white.wgsl' },
3806
+ { startIndex: 2, type: 'keyword.wgsl' },
3807
+ { startIndex: 8, type: 'white.wgsl' },
3808
+ { startIndex: 9, type: 'identifier.wgsl' },
3809
+ { startIndex: 10, type: 'delimiter.wgsl' }
3810
+ ]
3811
+ },
3812
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.wgsl' }] },
3813
+ { line: '', tokens: [] },
3814
+ { line: '@fragment', tokens: [{ startIndex: 0, type: 'annotation.wgsl' }] },
3815
+ {
3816
+ line: 'fn fmain(@builtin(position) pos: vec4f) -> @location(0) vec4f {',
3817
+ tokens: [
3818
+ { startIndex: 0, type: 'keyword.wgsl' },
3819
+ { startIndex: 2, type: 'white.wgsl' },
3820
+ { startIndex: 3, type: 'identifier.wgsl' },
3821
+ { startIndex: 8, type: 'delimiter.parenthesis.wgsl' },
3822
+ { startIndex: 9, type: 'annotation.wgsl' },
3823
+ { startIndex: 17, type: 'delimiter.parenthesis.wgsl' },
3824
+ { startIndex: 18, type: 'variable.predefined.wgsl' },
3825
+ { startIndex: 26, type: 'delimiter.parenthesis.wgsl' },
3826
+ { startIndex: 27, type: 'white.wgsl' },
3827
+ { startIndex: 28, type: 'identifier.wgsl' },
3828
+ { startIndex: 31, type: 'delimiter.wgsl' },
3829
+ { startIndex: 32, type: 'white.wgsl' },
3830
+ { startIndex: 33, type: 'variable.predefined.wgsl' },
3831
+ { startIndex: 38, type: 'delimiter.parenthesis.wgsl' },
3832
+ { startIndex: 39, type: 'white.wgsl' },
3833
+ { startIndex: 40, type: 'operator.wgsl' },
3834
+ { startIndex: 42, type: 'white.wgsl' },
3835
+ { startIndex: 43, type: 'annotation.wgsl' },
3836
+ { startIndex: 52, type: 'delimiter.parenthesis.wgsl' },
3837
+ { startIndex: 53, type: 'number.wgsl' },
3838
+ { startIndex: 54, type: 'delimiter.parenthesis.wgsl' },
3839
+ { startIndex: 55, type: 'white.wgsl' },
3840
+ { startIndex: 56, type: 'variable.predefined.wgsl' },
3841
+ { startIndex: 61, type: 'white.wgsl' },
3842
+ { startIndex: 62, type: 'delimiter.curly.wgsl' }
3843
+ ]
3844
+ },
3845
+ {
3846
+ line: ' return vec4f(0.25,0.25,1.0,1.0);',
3847
+ tokens: [
3848
+ { startIndex: 0, type: 'white.wgsl' },
3849
+ { startIndex: 2, type: 'keyword.wgsl' },
3850
+ { startIndex: 8, type: 'white.wgsl' },
3851
+ { startIndex: 9, type: 'variable.predefined.wgsl' },
3852
+ { startIndex: 14, type: 'delimiter.parenthesis.wgsl' },
3853
+ { startIndex: 15, type: 'number.float.wgsl' },
3854
+ { startIndex: 19, type: 'delimiter.wgsl' },
3855
+ { startIndex: 20, type: 'number.float.wgsl' },
3856
+ { startIndex: 24, type: 'delimiter.wgsl' },
3857
+ { startIndex: 25, type: 'number.float.wgsl' },
3858
+ { startIndex: 28, type: 'delimiter.wgsl' },
3859
+ { startIndex: 29, type: 'number.float.wgsl' },
3860
+ { startIndex: 32, type: 'delimiter.parenthesis.wgsl' },
3861
+ { startIndex: 33, type: 'delimiter.wgsl' }
3862
+ ]
3863
+ },
3864
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.wgsl' }] }
3865
+ ],
3866
+ // type generators
3867
+ [
3868
+ {
3869
+ line: '// Test predeclared type generators, other than vector, matrix, and texture.',
3870
+ tokens: [{ startIndex: 0, type: 'comment.wgsl' }]
3871
+ },
3872
+ {
3873
+ line: 'alias a=array<f32>;',
3874
+ tokens: [
3875
+ { startIndex: 0, type: 'keyword.wgsl' },
3876
+ { startIndex: 5, type: 'white.wgsl' },
3877
+ { startIndex: 6, type: 'identifier.wgsl' },
3878
+ { startIndex: 7, type: 'operator.wgsl' },
3879
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
3880
+ { startIndex: 13, type: 'operator.wgsl' },
3881
+ { startIndex: 14, type: 'variable.predefined.wgsl' },
3882
+ { startIndex: 17, type: 'delimiter.wgsl' }
3883
+ ]
3884
+ },
3885
+ {
3886
+ line: 'alias b=atomic<i32>;',
3887
+ tokens: [
3888
+ { startIndex: 0, type: 'keyword.wgsl' },
3889
+ { startIndex: 5, type: 'white.wgsl' },
3890
+ { startIndex: 6, type: 'identifier.wgsl' },
3891
+ { startIndex: 7, type: 'operator.wgsl' },
3892
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
3893
+ { startIndex: 14, type: 'operator.wgsl' },
3894
+ { startIndex: 15, type: 'variable.predefined.wgsl' },
3895
+ { startIndex: 18, type: 'delimiter.wgsl' }
3896
+ ]
3897
+ },
3898
+ {
3899
+ line: 'alias c=ptr<function,i32>;',
3900
+ tokens: [
3901
+ { startIndex: 0, type: 'keyword.wgsl' },
3902
+ { startIndex: 5, type: 'white.wgsl' },
3903
+ { startIndex: 6, type: 'identifier.wgsl' },
3904
+ { startIndex: 7, type: 'operator.wgsl' },
3905
+ { startIndex: 8, type: 'variable.predefined.wgsl' },
3906
+ { startIndex: 11, type: 'operator.wgsl' },
3907
+ { startIndex: 12, type: 'variable.predefined.wgsl' },
3908
+ { startIndex: 20, type: 'delimiter.wgsl' },
3909
+ { startIndex: 21, type: 'variable.predefined.wgsl' },
3910
+ { startIndex: 24, type: 'delimiter.wgsl' }
3911
+ ]
3912
+ }
3913
+ ]
3914
+ ];
3915
+ testTokenization('wgsl', cases);