From 08f81975c88752b69418b23ba017ba6f9c9bc06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ku=C4=8Dera?= <10546952+miloush@users.noreply.github.com> Date: Mon, 27 Mar 2023 18:55:10 +0100 Subject: [PATCH 01/12] Include .xsd and .xslt as an XML extension. --- src/basic-languages/xml/xml.contribution.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/basic-languages/xml/xml.contribution.ts b/src/basic-languages/xml/xml.contribution.ts index dbc1348d..1a58c066 100644 --- a/src/basic-languages/xml/xml.contribution.ts +++ b/src/basic-languages/xml/xml.contribution.ts @@ -12,6 +12,7 @@ registerLanguage({ id: 'xml', extensions: [ '.xml', + '.xsd', '.dtd', '.ascx', '.csproj', @@ -25,6 +26,7 @@ registerLanguage({ '.svg', '.svgz', '.opf', + '.xslt', '.xsl' ], firstLine: '(\\<\\?xml.*)|(\\ Date: Fri, 31 Mar 2023 11:20:41 +0200 Subject: [PATCH 02/12] Fixes #3534 --- package-lock.json | 14 +++++++------- package.json | 2 +- src/basic-languages/_.contribution.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b6ce9e6..6b3dcd2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "jsdom": "^19.0.0", "jsonc-parser": "^3.0.0", "mocha": "^9.2.0", - "monaco-editor-core": "^0.36.0-dev.20230224", + "monaco-editor-core": "^0.37.0-dev.20230330", "parcel": "^2.7.0", "pin-github-action": "^1.8.0", "playwright": "^1.18.1", @@ -5170,9 +5170,9 @@ "dev": true }, "node_modules/monaco-editor-core": { - "version": "0.36.0-dev.20230224", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.36.0-dev.20230224.tgz", - "integrity": "sha512-ubH2YoU86gNvO/lG4Un62ZGCwmzJXrMZFUw6VfwuFYgWAKflCZXHssrQKVsr0NwwyEJIn3Z4pURlo2ja3xAfIg==", + "version": "0.37.0-dev.20230330", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.37.0-dev.20230330.tgz", + "integrity": "sha512-GHp8zu1tTHWbdBzo6A7/P3Sdsn1LgXIzh5I8kI7RWm5jBSIlnet0t+3hDXXyaoXX4zohIMW5hN7ADsihBwKkSQ==", "dev": true }, "node_modules/mri": { @@ -10943,9 +10943,9 @@ } }, "monaco-editor-core": { - "version": "0.36.0-dev.20230224", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.36.0-dev.20230224.tgz", - "integrity": "sha512-ubH2YoU86gNvO/lG4Un62ZGCwmzJXrMZFUw6VfwuFYgWAKflCZXHssrQKVsr0NwwyEJIn3Z4pURlo2ja3xAfIg==", + "version": "0.37.0-dev.20230330", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.37.0-dev.20230330.tgz", + "integrity": "sha512-GHp8zu1tTHWbdBzo6A7/P3Sdsn1LgXIzh5I8kI7RWm5jBSIlnet0t+3hDXXyaoXX4zohIMW5hN7ADsihBwKkSQ==", "dev": true }, "mri": { diff --git a/package.json b/package.json index 33c40bd7..c6596887 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "jsdom": "^19.0.0", "jsonc-parser": "^3.0.0", "mocha": "^9.2.0", - "monaco-editor-core": "^0.36.0-dev.20230224", + "monaco-editor-core": "^0.37.0-dev.20230330", "parcel": "^2.7.0", "pin-github-action": "^1.8.0", "playwright": "^1.18.1", diff --git a/src/basic-languages/_.contribution.ts b/src/basic-languages/_.contribution.ts index 0a7efdf8..f0983d1c 100644 --- a/src/basic-languages/_.contribution.ts +++ b/src/basic-languages/_.contribution.ts @@ -73,7 +73,7 @@ export function registerLanguage(def: ILang): void { return mod.language; } }); - languages.onLanguage(languageId, async () => { + languages.onLanguageEncountered(languageId, async () => { const mod = await lazyLanguageLoader.load(); languages.setLanguageConfiguration(languageId, mod.conf); }); From 4886e1da087e36c3c8211208e8000199762e5749 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 31 Mar 2023 12:29:44 +0200 Subject: [PATCH 03/12] Fixes webcomponent sample for local development --- .../creating-the-editor/web-component/sample.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js b/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js index 07dc477f..9f178b30 100644 --- a/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js +++ b/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js @@ -11,10 +11,12 @@ customElements.define( const shadowRoot = this.attachShadow({ mode: "open" }); // Copy over editor styles - const style = document.querySelector( - "link[rel='stylesheet'][data-name='vs/editor/editor.main']" + const styles = document.querySelectorAll( + "link[rel='stylesheet'][data-name^='vs/']" ); - shadowRoot.appendChild(style.cloneNode(true)); + for (const style of styles) { + shadowRoot.appendChild(style.cloneNode(true)); + } const template = /** @type HTMLTemplateElement */ ( document.getElementById("editor-template") From b61b4d70e3987f670f813009e0e689ef12afafe7 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 3 Apr 2023 12:29:48 +0200 Subject: [PATCH 04/12] Adopts latest monaco-editor-core --- package-lock.json | 14 +++++++------- package.json | 2 +- src/language/common/lspLanguageFeatures.ts | 2 ++ src/language/typescript/languageFeatures.ts | 2 ++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6b3dcd2d..15de8814 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "jsdom": "^19.0.0", "jsonc-parser": "^3.0.0", "mocha": "^9.2.0", - "monaco-editor-core": "^0.37.0-dev.20230330", + "monaco-editor-core": "^0.37.0-dev.20230403", "parcel": "^2.7.0", "pin-github-action": "^1.8.0", "playwright": "^1.18.1", @@ -5170,9 +5170,9 @@ "dev": true }, "node_modules/monaco-editor-core": { - "version": "0.37.0-dev.20230330", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.37.0-dev.20230330.tgz", - "integrity": "sha512-GHp8zu1tTHWbdBzo6A7/P3Sdsn1LgXIzh5I8kI7RWm5jBSIlnet0t+3hDXXyaoXX4zohIMW5hN7ADsihBwKkSQ==", + "version": "0.37.0-dev.20230403", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.37.0-dev.20230403.tgz", + "integrity": "sha512-p77v5G3WNBSSCLY8ORkNkP5XmAOQj7QwxkyzyILj+sWFbw3/1B9SIead0QS368FHV7JKCZ8/LR5T5ccBUZJlJg==", "dev": true }, "node_modules/mri": { @@ -10943,9 +10943,9 @@ } }, "monaco-editor-core": { - "version": "0.37.0-dev.20230330", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.37.0-dev.20230330.tgz", - "integrity": "sha512-GHp8zu1tTHWbdBzo6A7/P3Sdsn1LgXIzh5I8kI7RWm5jBSIlnet0t+3hDXXyaoXX4zohIMW5hN7ADsihBwKkSQ==", + "version": "0.37.0-dev.20230403", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.37.0-dev.20230403.tgz", + "integrity": "sha512-p77v5G3WNBSSCLY8ORkNkP5XmAOQj7QwxkyzyILj+sWFbw3/1B9SIead0QS368FHV7JKCZ8/LR5T5ccBUZJlJg==", "dev": true }, "mri": { diff --git a/package.json b/package.json index c6596887..0bd0cd9b 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "jsdom": "^19.0.0", "jsonc-parser": "^3.0.0", "mocha": "^9.2.0", - "monaco-editor-core": "^0.37.0-dev.20230330", + "monaco-editor-core": "^0.37.0-dev.20230403", "parcel": "^2.7.0", "pin-github-action": "^1.8.0", "playwright": "^1.18.1", diff --git a/src/language/common/lspLanguageFeatures.ts b/src/language/common/lspLanguageFeatures.ts index ac98a59b..48982daf 100644 --- a/src/language/common/lspLanguageFeatures.ts +++ b/src/language/common/lspLanguageFeatures.ts @@ -803,6 +803,8 @@ export class DocumentFormattingEditProvider export class DocumentRangeFormattingEditProvider implements languages.DocumentRangeFormattingEditProvider { + readonly canFormatMultipleRanges = false; + constructor(private _worker: WorkerAccessor) {} public provideDocumentRangeFormattingEdits( diff --git a/src/language/typescript/languageFeatures.ts b/src/language/typescript/languageFeatures.ts index 9f6cbb77..28e58dda 100644 --- a/src/language/typescript/languageFeatures.ts +++ b/src/language/typescript/languageFeatures.ts @@ -989,6 +989,8 @@ export class FormatAdapter extends FormatHelper implements languages.DocumentRangeFormattingEditProvider { + readonly canFormatMultipleRanges = false; + public async provideDocumentRangeFormattingEdits( model: editor.ITextModel, range: Range, From 3724eefaf58a308accbbeff1126d8b2e44ea3ecd Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 30 Mar 2023 12:11:20 -0400 Subject: [PATCH 05/12] Add WebGPU Shading Language tokenizer, with tests Fixes: #3883 --- src/basic-languages/monaco.contribution.ts | 1 + src/basic-languages/wgsl/wgsl.contribution.ts | 24 + src/basic-languages/wgsl/wgsl.test.ts | 3915 +++++++++++++++++ src/basic-languages/wgsl/wgsl.ts | 487 ++ .../website/data/home-samples/sample.wgsl.txt | 48 + 5 files changed, 4475 insertions(+) create mode 100644 src/basic-languages/wgsl/wgsl.contribution.ts create mode 100644 src/basic-languages/wgsl/wgsl.test.ts create mode 100644 src/basic-languages/wgsl/wgsl.ts create mode 100644 website/src/website/data/home-samples/sample.wgsl.txt diff --git a/src/basic-languages/monaco.contribution.ts b/src/basic-languages/monaco.contribution.ts index db51ca61..74531ece 100644 --- a/src/basic-languages/monaco.contribution.ts +++ b/src/basic-languages/monaco.contribution.ts @@ -79,5 +79,6 @@ import './tcl/tcl.contribution'; import './twig/twig.contribution'; import './typescript/typescript.contribution'; import './vb/vb.contribution'; +import './wgsl/wgsl.contribution'; import './xml/xml.contribution'; import './yaml/yaml.contribution'; diff --git a/src/basic-languages/wgsl/wgsl.contribution.ts b/src/basic-languages/wgsl/wgsl.contribution.ts new file mode 100644 index 00000000..10802ffd --- /dev/null +++ b/src/basic-languages/wgsl/wgsl.contribution.ts @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { registerLanguage } from '../_.contribution'; + +declare var AMD: any; +declare var require: any; + +registerLanguage({ + id: 'wgsl', + extensions: ['.wgsl'], + aliases: ['WebGPU Shading Language', 'WGSL', 'wgsl'], + loader: () => { + if (AMD) { + return new Promise((resolve, reject) => { + require(['vs/basic-languages/wgsl/wgsl'], resolve, reject); + }); + } else { + return import('./wgsl'); + } + } +}); diff --git a/src/basic-languages/wgsl/wgsl.test.ts b/src/basic-languages/wgsl/wgsl.test.ts new file mode 100644 index 00000000..237c4fd6 --- /dev/null +++ b/src/basic-languages/wgsl/wgsl.test.ts @@ -0,0 +1,3915 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation, Google LLC. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { testTokenization, ITestItem } from '../test/testRunner'; + +const cases: ITestItem[][] = [ + // address space + [ + { + line: 'alias a=ptr;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'operator.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 20, type: 'delimiter.wgsl' }, + { startIndex: 21, type: 'variable.predefined.wgsl' }, + { startIndex: 24, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias b=ptr;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'operator.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' }, + { startIndex: 20, type: 'variable.predefined.wgsl' }, + { startIndex: 23, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias c=ptr;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'operator.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' }, + { startIndex: 22, type: 'variable.predefined.wgsl' }, + { startIndex: 25, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias d=ptr;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'operator.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' }, + { startIndex: 20, type: 'variable.predefined.wgsl' }, + { startIndex: 23, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias e=ptr;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'operator.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' }, + { startIndex: 20, type: 'variable.predefined.wgsl' }, + { startIndex: 23, type: 'delimiter.wgsl' } + ] + } + ], + // attribute + [ + { + line: '@id(0) override x:i32 = 1;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 3, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 4, type: 'number.wgsl' }, + { startIndex: 5, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 6, type: 'white.wgsl' }, + { startIndex: 7, type: 'keyword.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'identifier.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'operator.wgsl' }, + { startIndex: 23, type: 'white.wgsl' }, + { startIndex: 24, type: 'number.wgsl' }, + { startIndex: 25, type: 'delimiter.wgsl' } + ] + }, + { + line: '@ id(1) override y:i32 = 2;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'annotation.wgsl' }, + { startIndex: 4, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'keyword.wgsl' }, + { startIndex: 16, type: 'white.wgsl' }, + { startIndex: 17, type: 'identifier.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' }, + { startIndex: 19, type: 'variable.predefined.wgsl' }, + { startIndex: 22, type: 'white.wgsl' }, + { startIndex: 23, type: 'operator.wgsl' }, + { startIndex: 24, type: 'white.wgsl' }, + { startIndex: 25, type: 'number.wgsl' }, + { startIndex: 26, type: 'delimiter.wgsl' } + ] + }, + { + line: '@//comment', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 1, type: 'comment.wgsl' } + ] + }, + { + line: 'id(1) override z:i32 = 3;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 2, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 3, type: 'number.wgsl' }, + { startIndex: 4, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'keyword.wgsl' }, + { startIndex: 14, type: 'white.wgsl' }, + { startIndex: 15, type: 'identifier.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 20, type: 'white.wgsl' }, + { startIndex: 21, type: 'operator.wgsl' }, + { startIndex: 22, type: 'white.wgsl' }, + { startIndex: 23, type: 'number.wgsl' }, + { startIndex: 24, type: 'delimiter.wgsl' } + ] + }, + { + line: '@must_use fn foo() -> i32 { return 32; }', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'keyword.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'identifier.wgsl' }, + { startIndex: 16, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 18, type: 'white.wgsl' }, + { startIndex: 19, type: 'operator.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'variable.predefined.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'delimiter.curly.wgsl' }, + { startIndex: 27, type: 'white.wgsl' }, + { startIndex: 28, type: 'keyword.wgsl' }, + { startIndex: 34, type: 'white.wgsl' }, + { startIndex: 35, type: 'number.wgsl' }, + { startIndex: 37, type: 'delimiter.wgsl' }, + { startIndex: 38, type: 'white.wgsl' }, + { startIndex: 39, type: 'delimiter.curly.wgsl' } + ] + } + ], + // block comment + [ + { + line: ' /**/', + tokens: [ + { startIndex: 0, type: 'white.wgsl' }, + { startIndex: 1, type: 'comment.wgsl' } + ] + }, + { + line: ' /*block with newline', + tokens: [ + { startIndex: 0, type: 'white.wgsl' }, + { startIndex: 1, type: 'comment.wgsl' } + ] + }, + { line: ' */', tokens: [{ startIndex: 0, type: 'comment.wgsl' }] }, + { + line: ' /*block with line', + tokens: [ + { startIndex: 0, type: 'white.wgsl' }, + { startIndex: 1, type: 'comment.wgsl' } + ] + }, + { line: ' ending comment// */', tokens: [{ startIndex: 0, type: 'comment.wgsl' }] }, + { + line: ' /* nested /*', + tokens: [ + { startIndex: 0, type: 'white.wgsl' }, + { startIndex: 1, type: 'comment.wgsl' } + ] + }, + { line: ' */', tokens: [{ startIndex: 0, type: 'comment.wgsl' }] }, + { line: ' */', tokens: [{ startIndex: 0, type: 'comment.wgsl' }] } + ], + // bool types + [ + { + line: 'alias boolean=bool;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 13, type: 'operator.wgsl' }, + { startIndex: 14, type: 'variable.predefined.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias bvec2=vec2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias bvec3=vec3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias bvec4=vec4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + } + ], + // brackets + [ + { + line: 'const one = array(1)[0];', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 18, type: 'number.wgsl' }, + { startIndex: 19, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 20, type: 'delimiter.square.wgsl' }, + { startIndex: 21, type: 'number.wgsl' }, + { startIndex: 22, type: 'delimiter.square.wgsl' }, + { startIndex: 23, type: 'delimiter.wgsl' } + ] + }, + { + line: 'fn none() {}', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 2, type: 'white.wgsl' }, + { startIndex: 3, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'delimiter.curly.wgsl' } + ] + } + ], + // const numbers + [ + { + line: 'const a = 0;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.wgsl' }, + { startIndex: 11, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const au = 0u;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.wgsl' }, + { startIndex: 13, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const ai = 0i;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.wgsl' }, + { startIndex: 13, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const b = 12345;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const bu = 12345u;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const bi= 12345i;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const c = 0x0;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.hex.wgsl' }, + { startIndex: 13, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const cu = 0x0u;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const ci = 0x0i;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const d = 0x12345;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.hex.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const di = 0x12345i;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const du = 0x12345u;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const eh = 0h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 13, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const ef = 0f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 13, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const f = 1.;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 12, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const fh = 1.h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const ff = 1.f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const g = .1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 12, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const gh = .1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const gf = .1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const g = 1e1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 13, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const gh = 1e1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const gf = 1e1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const h = 1e+1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const hh = 1e+1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const hf = 1e+1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const i = 1e-1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const ih = 1e-1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const if = 1e-1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'keyword.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const j = 1.0e+1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const jh = 1.0e+1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const jf= 1.0e+1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const k = 1.0e-1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const kh = 1.0e-1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.float.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const kf= 1.0e-1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.float.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const l = 0x1p1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.hex.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const lh = 0x1p1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const lf = 0x1p1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const m = 0x1p+1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.hex.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const mh = 0x1p+1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const mf = 0x1p+1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const n = 0x1p-1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.hex.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const nh = 0x1p-1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const nf = 0x1p-1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const oo = 0x1.p1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const ooh = 0x1.p1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'number.hex.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const oof = 0x1.p1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'number.hex.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const p = 0x.1p1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'operator.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'number.hex.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const ph = 0x.1p1h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const pf = 0x.1p1f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.hex.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + } + ], + // depth texture + [ + { + line: '@group(0) @binding(1) var texture_depth_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 42, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(2) var texture_depth_2d_array;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 48, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(4) var texture_depth_cube;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(5) var texture_depth_cube_array;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 50, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(5) var texture_depth_multisampled_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' } + ] + } + ], + // directive + [ + { + line: 'enable f16;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 6, type: 'white.wgsl' }, + { startIndex: 7, type: 'meta.content.wgsl' }, + { startIndex: 10, type: 'delimiter.wgsl' } + ] + }, + { + line: 'requires v1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'meta.content.wgsl' }, + { startIndex: 11, type: 'delimiter.wgsl' } + ] + }, + { + line: 'diagnostic(error,derivative_uniformity);', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 10, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 11, type: 'meta.content.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' }, + { startIndex: 17, type: 'meta.content.wgsl' }, + { startIndex: 38, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 39, type: 'delimiter.wgsl' } + ] + }, + { + line: 'diagnostic(warning,derivative_uniformity);', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 10, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 11, type: 'meta.content.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' }, + { startIndex: 19, type: 'meta.content.wgsl' }, + { startIndex: 40, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 41, type: 'delimiter.wgsl' } + ] + }, + { + line: 'diagnostic(off,derivative_uniformity);', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 10, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 11, type: 'meta.content.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' }, + { startIndex: 15, type: 'meta.content.wgsl' }, + { startIndex: 36, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 37, type: 'delimiter.wgsl' } + ] + }, + { + line: 'diagnostic(info,derivative_uniformity);', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 10, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 11, type: 'meta.content.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' }, + { startIndex: 16, type: 'meta.content.wgsl' }, + { startIndex: 37, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 38, type: 'delimiter.wgsl' } + ] + }, + { line: '', tokens: [] }, + { + line: '@diagnostic(off,derviative_uniformity) fn main() {}', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 11, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 12, type: 'identifier.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' }, + { startIndex: 16, type: 'identifier.wgsl' }, + { startIndex: 37, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 38, type: 'white.wgsl' }, + { startIndex: 39, type: 'keyword.wgsl' }, + { startIndex: 41, type: 'white.wgsl' }, + { startIndex: 42, type: 'identifier.wgsl' }, + { startIndex: 46, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 48, type: 'white.wgsl' }, + { startIndex: 49, type: 'delimiter.curly.wgsl' } + ] + } + ], + // external texture + [ + { + line: '@group(0) @binding(5) var texture_external;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 42, type: 'delimiter.wgsl' } + ] + } + ], + // keywords + [ + { line: 'alias', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'break', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'case', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'const', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'const_assert', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'continue', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'continuing', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'default', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'diagnostic', tokens: [{ startIndex: 0, type: 'keyword.wgsl' }] }, + { line: 'discard', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'else', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'enable', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'false', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'fn', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'for', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'if', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'let', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'loop', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'override', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'requires', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'return', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'struct', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'switch', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'true', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'var', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] }, + { line: 'while', tokens: [{ startIndex: 0, type: 'meta.content.wgsl' }] } + ], + // line comment + [ + { + line: ' // this is a line-ending comment', + tokens: [ + { startIndex: 0, type: 'white.wgsl' }, + { startIndex: 2, type: 'comment.wgsl' } + ] + }, + { + line: ' //* embed a bock comment start, after a space', + tokens: [ + { startIndex: 0, type: 'white.wgsl' }, + { startIndex: 1, type: 'comment.wgsl' } + ] + }, + { + line: '// /* embed a bock comment start, v2', + tokens: [{ startIndex: 0, type: 'comment.wgsl' }] + } + ], + // multisampled texture + [ + { + line: '@group(0) @binding(5) var texture_multisampled_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 49, type: 'operator.wgsl' }, + { startIndex: 50, type: 'variable.predefined.wgsl' }, + { startIndex: 53, type: 'delimiter.wgsl' } + ] + } + ], + // numeric types + [ + { + line: 'enable f16;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 6, type: 'white.wgsl' }, + { startIndex: 7, type: 'meta.content.wgsl' }, + { startIndex: 10, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias int=i32;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 13, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias uint=u32;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias float=f32;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias half=f16;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias ivec2=vec2i;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias uvec2=vec2u;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias vec2=vec2f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'variable.predefined.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias ivec3=vec3i;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias uvec3=vec3u;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias vec3=vec3f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'variable.predefined.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias ivec4=vec4i;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias uvec4=vec4u;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias ivec2_=vec2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias uvec2_=vec2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias vec2_=vec2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 20, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias ivec3_=vec3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias uvec3_=vec3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias vec3_=vec3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 20, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias ivec4_=vec4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias uvec4_=vec4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias vec4_=vec4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 20, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias hvec2=vec2h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias hvec3=vec3h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias hvec4=vec4h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias hvec4_=vec4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m22=mat2x2f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m23=mat2x3f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m24=mat2x4f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m32=mat3x2f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m33=mat3x3f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m34=mat3x4f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m42=mat4x2f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m43=mat4x3f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m44=mat4x4f;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m22_=mat2x2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m23_=mat2x3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m24_=mat2x4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m32_=mat3x2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m33_=mat3x3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m34_=mat3x4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m42_=mat4x2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m43_=mat4x3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m44_=mat4x4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m22=mat2x2h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias m23=mat2x3h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h24=mat2x4h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h32=mat3x2h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h33=mat3x3h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h34=mat3x4h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h42=mat4x2h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h43=mat4x3h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h44=mat4x4h;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h22_=mat2x2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h23_=mat2x3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h24_=mat2x4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h32_=mat3x2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h33_=mat3x3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h34_=mat3x4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h42_=mat4x2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h43_=mat4x3;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias h44_=mat4x4;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'delimiter.wgsl' } + ] + } + ], + // operators + [ + { + line: 'const add = 0+1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'number.wgsl' }, + { startIndex: 13, type: 'operator.wgsl' }, + { startIndex: 14, type: 'number.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const sub = 0-1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'number.wgsl' }, + { startIndex: 13, type: 'operator.wgsl' }, + { startIndex: 14, type: 'number.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const mult = 1*0;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'number.wgsl' }, + { startIndex: 14, type: 'operator.wgsl' }, + { startIndex: 15, type: 'number.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const div = 1/0;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'number.wgsl' }, + { startIndex: 13, type: 'operator.wgsl' }, + { startIndex: 14, type: 'number.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const rem = 2%1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'number.wgsl' }, + { startIndex: 13, type: 'operator.wgsl' }, + { startIndex: 14, type: 'number.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const xor = 1^2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'number.wgsl' }, + { startIndex: 13, type: 'delimiter.wgsl' }, + { startIndex: 14, type: 'number.wgsl' }, + { startIndex: 15, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const or = 1|2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'operator.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'number.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'number.wgsl' }, + { startIndex: 14, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const not = !false;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'operator.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'delimiter.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const complement = ~1u;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 16, type: 'white.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'white.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' }, + { startIndex: 20, type: 'number.wgsl' }, + { startIndex: 22, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const less = 1<0;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'number.wgsl' }, + { startIndex: 14, type: 'operator.wgsl' }, + { startIndex: 15, type: 'number.wgsl' }, + { startIndex: 16, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const lesseq = 1<=0;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'operator.wgsl' }, + { startIndex: 14, type: 'white.wgsl' }, + { startIndex: 15, type: 'number.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 18, type: 'number.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const equal = 1==2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'white.wgsl' }, + { startIndex: 14, type: 'number.wgsl' }, + { startIndex: 15, type: 'operator.wgsl' }, + { startIndex: 17, type: 'number.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const greater = 1>2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 13, type: 'white.wgsl' }, + { startIndex: 14, type: 'operator.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'number.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'number.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const greatereq = 1>=2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 17, type: 'white.wgsl' }, + { startIndex: 18, type: 'number.wgsl' }, + { startIndex: 19, type: 'operator.wgsl' }, + { startIndex: 21, type: 'number.wgsl' }, + { startIndex: 22, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const noteq = 1!=2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 13, type: 'white.wgsl' }, + { startIndex: 14, type: 'number.wgsl' }, + { startIndex: 15, type: 'operator.wgsl' }, + { startIndex: 17, type: 'number.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const leftshift = 1<<2;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'operator.wgsl' }, + { startIndex: 17, type: 'white.wgsl' }, + { startIndex: 18, type: 'number.wgsl' }, + { startIndex: 19, type: 'operator.wgsl' }, + { startIndex: 21, type: 'number.wgsl' }, + { startIndex: 22, type: 'delimiter.wgsl' } + ] + }, + { + line: 'const rightshift = 2>>1;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 16, type: 'white.wgsl' }, + { startIndex: 17, type: 'operator.wgsl' }, + { startIndex: 18, type: 'white.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'operator.wgsl' }, + { startIndex: 22, type: 'number.wgsl' }, + { startIndex: 23, type: 'delimiter.wgsl' } + ] + }, + { + line: 'fn arith() -> i32 {', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 2, type: 'white.wgsl' }, + { startIndex: 3, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 13, type: 'white.wgsl' }, + { startIndex: 14, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'white.wgsl' }, + { startIndex: 18, type: 'delimiter.curly.wgsl' } + ] + }, + { + line: 'var a: i32;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 3, type: 'white.wgsl' }, + { startIndex: 4, type: 'identifier.wgsl' }, + { startIndex: 5, type: 'delimiter.wgsl' }, + { startIndex: 6, type: 'white.wgsl' }, + { startIndex: 7, type: 'variable.predefined.wgsl' }, + { startIndex: 10, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a += 1;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a -= 1;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a *= 1;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a /= 1;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a %= 2;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a ^= 2;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a &= 2;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a |= 2;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'number.wgsl' }, + { startIndex: 6, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a <<= 1;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'number.wgsl' }, + { startIndex: 7, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a >>= 1;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'white.wgsl' }, + { startIndex: 2, type: 'operator.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'number.wgsl' }, + { startIndex: 7, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a++;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'delimiter.wgsl' } + ] + }, + { + line: 'a--;', + tokens: [ + { startIndex: 0, type: 'identifier.wgsl' }, + { startIndex: 1, type: 'delimiter.wgsl' } + ] + }, + { + line: 'let b = true&&false;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 3, type: 'white.wgsl' }, + { startIndex: 4, type: 'identifier.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'operator.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 14, type: 'variable.predefined.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' } + ] + }, + { + line: 'let c = true||false;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 3, type: 'white.wgsl' }, + { startIndex: 4, type: 'identifier.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'operator.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 12, type: 'operator.wgsl' }, + { startIndex: 14, type: 'variable.predefined.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' } + ] + }, + { + line: 'return a;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 6, type: 'white.wgsl' }, + { startIndex: 7, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'delimiter.wgsl' } + ] + }, + { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.wgsl' }] } + ], + // predeclared + [ + { + line: 'read write read_write', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'variable.predefined.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'function private workgroup uniform storage', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'white.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 26, type: 'white.wgsl' }, + { startIndex: 27, type: 'variable.predefined.wgsl' }, + { startIndex: 34, type: 'white.wgsl' }, + { startIndex: 35, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'perspective linear flat', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 18, type: 'white.wgsl' }, + { startIndex: 19, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'center centroid sample', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 6, type: 'white.wgsl' }, + { startIndex: 7, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'vertex_index instance_index position front_facing frag_depth', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 27, type: 'white.wgsl' }, + { startIndex: 28, type: 'variable.predefined.wgsl' }, + { startIndex: 36, type: 'white.wgsl' }, + { startIndex: 37, type: 'variable.predefined.wgsl' }, + { startIndex: 49, type: 'white.wgsl' }, + { startIndex: 50, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'local_invocation_id local_invocation_index', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 19, type: 'white.wgsl' }, + { startIndex: 20, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'global_invocation_id workgroup_id num_workgroups', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 20, type: 'white.wgsl' }, + { startIndex: 21, type: 'variable.predefined.wgsl' }, + { startIndex: 33, type: 'white.wgsl' }, + { startIndex: 34, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'sample_index sample_mask', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' } + ] + }, + { line: 'rgba8unorm', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba8snorm', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba8uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba8sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba16uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba16sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba16float', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'r32uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'r32sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'r32float', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rg32uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rg32sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rg32float', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba32uint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba32sint', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'rgba32float', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'bgra8unorm', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: '', tokens: [] }, + { line: 'bool', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'f16', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'f32', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'i32', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { + line: 'sampler sampler_comparison', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'texture_depth_2d', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_depth_2d_array', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_depth_cube', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_depth_cube_array', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_depth_multisampled_2d', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_external', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_external', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { line: 'u32', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: '', tokens: [] }, + { line: 'array', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'atomic', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat2x2', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat2x3', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat2x4', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat3x2', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat3x3', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat3x4', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat4x2', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat4x3', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'mat4x4', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'ptr', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'texture_1d', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'texture_2d', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { + line: 'texture_2d_array', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { line: 'texture_3d', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'texture_cube', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { + line: 'texture_cube_array', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_multisampled_2d', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_storage_1d', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_storage_2d', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_storage_2d_array', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { + line: 'texture_storage_3d', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + }, + { line: 'vec2', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'vec3', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: 'vec4', tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] }, + { line: '', tokens: [] }, + { + line: 'vec2i vec3i vec4i', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'vec2u vec3u vec4u', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'vec2f vec3f vec4f', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'vec2h vec3h vec4h', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'mat2x2f mat2x3f mat2x4f', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'mat3x2f mat3x3f mat3x4f', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'mat4x2f mat4x3f mat4x4f', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'mat2x2h mat2x3h mat2x4h', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'mat3x2h mat3x3h mat3x4h', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'mat4x2h mat4x3h mat4x4h', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' } + ] + }, + { line: '', tokens: [] }, + { + line: 'bitcast all any select arrayLength abs acos acosh asin asinh atan atanh atan2', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' }, + { startIndex: 22, type: 'white.wgsl' }, + { startIndex: 23, type: 'variable.predefined.wgsl' }, + { startIndex: 34, type: 'white.wgsl' }, + { startIndex: 35, type: 'variable.predefined.wgsl' }, + { startIndex: 38, type: 'white.wgsl' }, + { startIndex: 39, type: 'variable.predefined.wgsl' }, + { startIndex: 43, type: 'white.wgsl' }, + { startIndex: 44, type: 'variable.predefined.wgsl' }, + { startIndex: 49, type: 'white.wgsl' }, + { startIndex: 50, type: 'variable.predefined.wgsl' }, + { startIndex: 54, type: 'white.wgsl' }, + { startIndex: 55, type: 'variable.predefined.wgsl' }, + { startIndex: 60, type: 'white.wgsl' }, + { startIndex: 61, type: 'variable.predefined.wgsl' }, + { startIndex: 65, type: 'white.wgsl' }, + { startIndex: 66, type: 'variable.predefined.wgsl' }, + { startIndex: 71, type: 'white.wgsl' }, + { startIndex: 72, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'ceil clamp cos cosh countLeadingZeros countOneBits countTrailingZeros cross', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 4, type: 'white.wgsl' }, + { startIndex: 5, type: 'variable.predefined.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 14, type: 'white.wgsl' }, + { startIndex: 15, type: 'variable.predefined.wgsl' }, + { startIndex: 19, type: 'white.wgsl' }, + { startIndex: 20, type: 'variable.predefined.wgsl' }, + { startIndex: 37, type: 'white.wgsl' }, + { startIndex: 38, type: 'variable.predefined.wgsl' }, + { startIndex: 50, type: 'white.wgsl' }, + { startIndex: 51, type: 'variable.predefined.wgsl' }, + { startIndex: 69, type: 'white.wgsl' }, + { startIndex: 70, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'degrees determinant distance dot exp exp2 extractBits faceForward firstLeadingBit', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 7, type: 'white.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 19, type: 'white.wgsl' }, + { startIndex: 20, type: 'variable.predefined.wgsl' }, + { startIndex: 28, type: 'white.wgsl' }, + { startIndex: 29, type: 'variable.predefined.wgsl' }, + { startIndex: 32, type: 'white.wgsl' }, + { startIndex: 33, type: 'variable.predefined.wgsl' }, + { startIndex: 36, type: 'white.wgsl' }, + { startIndex: 37, type: 'variable.predefined.wgsl' }, + { startIndex: 41, type: 'white.wgsl' }, + { startIndex: 42, type: 'variable.predefined.wgsl' }, + { startIndex: 53, type: 'white.wgsl' }, + { startIndex: 54, type: 'variable.predefined.wgsl' }, + { startIndex: 65, type: 'white.wgsl' }, + { startIndex: 66, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'firstTrailingBit floor fma fract frexp inverseBits inverseSqrt ldexp length', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'white.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 22, type: 'white.wgsl' }, + { startIndex: 23, type: 'variable.predefined.wgsl' }, + { startIndex: 26, type: 'white.wgsl' }, + { startIndex: 27, type: 'variable.predefined.wgsl' }, + { startIndex: 32, type: 'white.wgsl' }, + { startIndex: 33, type: 'variable.predefined.wgsl' }, + { startIndex: 38, type: 'white.wgsl' }, + { startIndex: 39, type: 'variable.predefined.wgsl' }, + { startIndex: 50, type: 'white.wgsl' }, + { startIndex: 51, type: 'variable.predefined.wgsl' }, + { startIndex: 62, type: 'white.wgsl' }, + { startIndex: 63, type: 'variable.predefined.wgsl' }, + { startIndex: 68, type: 'white.wgsl' }, + { startIndex: 69, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'log log2 max min mix modf normalize pow quantizeToF16 radians reflect refract', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 3, type: 'white.wgsl' }, + { startIndex: 4, type: 'variable.predefined.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'variable.predefined.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'white.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 20, type: 'white.wgsl' }, + { startIndex: 21, type: 'variable.predefined.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 35, type: 'white.wgsl' }, + { startIndex: 36, type: 'variable.predefined.wgsl' }, + { startIndex: 39, type: 'white.wgsl' }, + { startIndex: 40, type: 'variable.predefined.wgsl' }, + { startIndex: 53, type: 'white.wgsl' }, + { startIndex: 54, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'white.wgsl' }, + { startIndex: 62, type: 'variable.predefined.wgsl' }, + { startIndex: 69, type: 'white.wgsl' }, + { startIndex: 70, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'reverseBits round saturate sign sin sinh smoothstep sqrt step tan tanh transpose', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'white.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'white.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 26, type: 'white.wgsl' }, + { startIndex: 27, type: 'variable.predefined.wgsl' }, + { startIndex: 31, type: 'white.wgsl' }, + { startIndex: 32, type: 'variable.predefined.wgsl' }, + { startIndex: 35, type: 'white.wgsl' }, + { startIndex: 36, type: 'variable.predefined.wgsl' }, + { startIndex: 40, type: 'white.wgsl' }, + { startIndex: 41, type: 'variable.predefined.wgsl' }, + { startIndex: 51, type: 'white.wgsl' }, + { startIndex: 52, type: 'variable.predefined.wgsl' }, + { startIndex: 56, type: 'white.wgsl' }, + { startIndex: 57, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'white.wgsl' }, + { startIndex: 62, type: 'variable.predefined.wgsl' }, + { startIndex: 65, type: 'white.wgsl' }, + { startIndex: 66, type: 'variable.predefined.wgsl' }, + { startIndex: 70, type: 'white.wgsl' }, + { startIndex: 71, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'trunc dpdx dpdxCoarse dpdxFine dpdy dpdyCoarse dpdyFine fwidth fwidthCoarse fwidthFine', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'variable.predefined.wgsl' }, + { startIndex: 10, type: 'white.wgsl' }, + { startIndex: 11, type: 'variable.predefined.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'variable.predefined.wgsl' }, + { startIndex: 30, type: 'white.wgsl' }, + { startIndex: 31, type: 'variable.predefined.wgsl' }, + { startIndex: 35, type: 'white.wgsl' }, + { startIndex: 36, type: 'variable.predefined.wgsl' }, + { startIndex: 46, type: 'white.wgsl' }, + { startIndex: 47, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'white.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 62, type: 'white.wgsl' }, + { startIndex: 63, type: 'variable.predefined.wgsl' }, + { startIndex: 75, type: 'white.wgsl' }, + { startIndex: 76, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'textureDimensions textureGather textureGatherCompare textureLoad textureNumLayers', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'white.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 31, type: 'white.wgsl' }, + { startIndex: 32, type: 'variable.predefined.wgsl' }, + { startIndex: 52, type: 'white.wgsl' }, + { startIndex: 53, type: 'variable.predefined.wgsl' }, + { startIndex: 64, type: 'white.wgsl' }, + { startIndex: 65, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'textureNumLevels textureNumSamples textureSample textureSampleBias textureSampleCompare', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 16, type: 'white.wgsl' }, + { startIndex: 17, type: 'variable.predefined.wgsl' }, + { startIndex: 34, type: 'white.wgsl' }, + { startIndex: 35, type: 'variable.predefined.wgsl' }, + { startIndex: 48, type: 'white.wgsl' }, + { startIndex: 49, type: 'variable.predefined.wgsl' }, + { startIndex: 66, type: 'white.wgsl' }, + { startIndex: 67, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'textureSampleCompareLevel textureSampleGrad textureSampleLevel textureSampleBaseClampToEdge', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 43, type: 'white.wgsl' }, + { startIndex: 44, type: 'variable.predefined.wgsl' }, + { startIndex: 62, type: 'white.wgsl' }, + { startIndex: 63, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'textureStore atomicLoad atomicStore atomicAdd atomicSub atomicMax atomicMin', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 23, type: 'white.wgsl' }, + { startIndex: 24, type: 'variable.predefined.wgsl' }, + { startIndex: 35, type: 'white.wgsl' }, + { startIndex: 36, type: 'variable.predefined.wgsl' }, + { startIndex: 45, type: 'white.wgsl' }, + { startIndex: 46, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'white.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 65, type: 'white.wgsl' }, + { startIndex: 66, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'atomicAnd atomicOr atomicXor atomicExchange atomicCompareExchangeWeak pack4x8snorm', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'variable.predefined.wgsl' }, + { startIndex: 18, type: 'white.wgsl' }, + { startIndex: 19, type: 'variable.predefined.wgsl' }, + { startIndex: 28, type: 'white.wgsl' }, + { startIndex: 29, type: 'variable.predefined.wgsl' }, + { startIndex: 43, type: 'white.wgsl' }, + { startIndex: 44, type: 'variable.predefined.wgsl' }, + { startIndex: 69, type: 'white.wgsl' }, + { startIndex: 70, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'pack4x8unorm pack2x16snorm pack2x16unorm pack2x16float unpack4x8snorm unpack4x8unorm', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 12, type: 'white.wgsl' }, + { startIndex: 13, type: 'variable.predefined.wgsl' }, + { startIndex: 26, type: 'white.wgsl' }, + { startIndex: 27, type: 'variable.predefined.wgsl' }, + { startIndex: 40, type: 'white.wgsl' }, + { startIndex: 41, type: 'variable.predefined.wgsl' }, + { startIndex: 54, type: 'white.wgsl' }, + { startIndex: 55, type: 'variable.predefined.wgsl' }, + { startIndex: 69, type: 'white.wgsl' }, + { startIndex: 70, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'unpack2x16snorm unpack2x16unorm unpack2x16float storageBarrier workgroupBarrier', + tokens: [ + { startIndex: 0, type: 'variable.predefined.wgsl' }, + { startIndex: 15, type: 'white.wgsl' }, + { startIndex: 16, type: 'variable.predefined.wgsl' }, + { startIndex: 31, type: 'white.wgsl' }, + { startIndex: 32, type: 'variable.predefined.wgsl' }, + { startIndex: 47, type: 'white.wgsl' }, + { startIndex: 48, type: 'variable.predefined.wgsl' }, + { startIndex: 62, type: 'white.wgsl' }, + { startIndex: 63, type: 'variable.predefined.wgsl' } + ] + }, + { + line: 'workgroupUniformLoad', + tokens: [{ startIndex: 0, type: 'variable.predefined.wgsl' }] + } + ], + // reserved + [ + { line: 'NULL', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'Self', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'abstract', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'active', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'alignas', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'alignof', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'as', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'asm', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'asm_fragment', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'async', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'attribute', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'auto', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'await', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'become', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'binding_array', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'catch', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'class', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'co_await', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'co_return', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'co_yield', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'coherent', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'column_major', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'common', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'compile', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'compile_fragment', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'concept', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'const_cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'consteval', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'constexpr', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'constinit', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'crate', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'debugger', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'decltype', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'delete', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'demote', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'demote_to_helper', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'do', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'dynamic_cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'enum', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'explicit', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'export', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'extends', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'extern', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'external', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'fallthrough', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'filter', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'final', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'finally', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'friend', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'from', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'fxgroup', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'get', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'goto', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'groupshared', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'highp', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'impl', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'implements', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'import', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'inline', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'instanceof', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'interface', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'layout', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'lowp', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'macro', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'macro_rules', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'match', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'mediump', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'meta', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'mod', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'module', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'move', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'mut', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'mutable', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'namespace', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'new', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'nil', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'noexcept', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'noinline', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'nointerpolation', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'noperspective', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'null', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'nullptr', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'of', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'operator', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'package', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'packoffset', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'partition', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'pass', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'patch', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'pixelfragment', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'precise', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'precision', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'premerge', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'priv', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'protected', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'pub', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'public', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'readonly', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'ref', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'regardless', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'register', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'reinterpret_cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'require', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'resource', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'restrict', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'self', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'set', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'shared', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'sizeof', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'smooth', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'snorm', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'static', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'static_assert', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'static_cast', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'std', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'subroutine', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'super', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'target', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'template', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'this', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'thread_local', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'throw', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'trait', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'try', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'type', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'typedef', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'typeid', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'typename', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'typeof', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'union', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'unless', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'unorm', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'unsafe', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'unsized', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'use', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'using', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'varying', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'virtual', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'volatile', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'wgsl', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'where', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'with', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'writeonly', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] }, + { line: 'yield', tokens: [{ startIndex: 0, type: 'invalid.wgsl' }] } + ], + // sampled texture + [ + { + line: '@group(0) @binding(0) var texture_1d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 36, type: 'operator.wgsl' }, + { startIndex: 37, type: 'variable.predefined.wgsl' }, + { startIndex: 40, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(1) var texture_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 36, type: 'operator.wgsl' }, + { startIndex: 37, type: 'variable.predefined.wgsl' }, + { startIndex: 40, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(2) var texture_2d_array;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 42, type: 'operator.wgsl' }, + { startIndex: 43, type: 'variable.predefined.wgsl' }, + { startIndex: 46, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(3) var texture_3d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 36, type: 'operator.wgsl' }, + { startIndex: 37, type: 'variable.predefined.wgsl' }, + { startIndex: 40, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(4) var texture_cube;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 38, type: 'operator.wgsl' }, + { startIndex: 39, type: 'variable.predefined.wgsl' }, + { startIndex: 42, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(5) var texture_cube_array;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 48, type: 'delimiter.wgsl' } + ] + } + ], + // storage texture + [ + { + line: '@group(0) @binding(0) var texture_storage_1d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(1) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(2) var texture_storage_2d_array;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 50, type: 'operator.wgsl' }, + { startIndex: 51, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' }, + { startIndex: 62, type: 'variable.predefined.wgsl' }, + { startIndex: 67, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(3) var texture_storage_3d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + } + ], + // texel formats + [ + { + line: '@group(0) @binding(0) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(1) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(2) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 54, type: 'delimiter.wgsl' }, + { startIndex: 55, type: 'variable.predefined.wgsl' }, + { startIndex: 60, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(3) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 54, type: 'delimiter.wgsl' }, + { startIndex: 55, type: 'variable.predefined.wgsl' }, + { startIndex: 60, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(4) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(5) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(6) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 56, type: 'delimiter.wgsl' }, + { startIndex: 57, type: 'variable.predefined.wgsl' }, + { startIndex: 62, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(7) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 52, type: 'delimiter.wgsl' }, + { startIndex: 53, type: 'variable.predefined.wgsl' }, + { startIndex: 58, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(8) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 52, type: 'delimiter.wgsl' }, + { startIndex: 53, type: 'variable.predefined.wgsl' }, + { startIndex: 58, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(0) @binding(9) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 53, type: 'delimiter.wgsl' }, + { startIndex: 54, type: 'variable.predefined.wgsl' }, + { startIndex: 59, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(1) @binding(0) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 53, type: 'delimiter.wgsl' }, + { startIndex: 54, type: 'variable.predefined.wgsl' }, + { startIndex: 59, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(1) @binding(1) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 53, type: 'delimiter.wgsl' }, + { startIndex: 54, type: 'variable.predefined.wgsl' }, + { startIndex: 59, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(1) @binding(2) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 54, type: 'delimiter.wgsl' }, + { startIndex: 55, type: 'variable.predefined.wgsl' }, + { startIndex: 60, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(1) @binding(3) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(1) @binding(4) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(1) @binding(5) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 56, type: 'delimiter.wgsl' }, + { startIndex: 57, type: 'variable.predefined.wgsl' }, + { startIndex: 62, type: 'delimiter.wgsl' } + ] + }, + { + line: '@group(1) @binding(6) var texture_storage_2d;', + tokens: [ + { startIndex: 0, type: 'annotation.wgsl' }, + { startIndex: 6, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 7, type: 'number.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'white.wgsl' }, + { startIndex: 10, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'keyword.wgsl' }, + { startIndex: 25, type: 'white.wgsl' }, + { startIndex: 26, type: 'variable.predefined.wgsl' }, + { startIndex: 44, type: 'operator.wgsl' }, + { startIndex: 45, type: 'variable.predefined.wgsl' }, + { startIndex: 55, type: 'delimiter.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'delimiter.wgsl' } + ] + } + ], + // tiny render + [ + { line: '@vertex', tokens: [{ startIndex: 0, type: 'annotation.wgsl' }] }, + { + line: 'fn vmain(@location(0) v: vec4) -> @builtin(position) vec4f {', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 2, type: 'white.wgsl' }, + { startIndex: 3, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'annotation.wgsl' }, + { startIndex: 18, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 19, type: 'number.wgsl' }, + { startIndex: 20, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 21, type: 'white.wgsl' }, + { startIndex: 22, type: 'identifier.wgsl' }, + { startIndex: 23, type: 'delimiter.wgsl' }, + { startIndex: 24, type: 'white.wgsl' }, + { startIndex: 25, type: 'variable.predefined.wgsl' }, + { startIndex: 29, type: 'operator.wgsl' }, + { startIndex: 30, type: 'variable.predefined.wgsl' }, + { startIndex: 33, type: 'operator.wgsl' }, + { startIndex: 34, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 35, type: 'white.wgsl' }, + { startIndex: 36, type: 'operator.wgsl' }, + { startIndex: 38, type: 'white.wgsl' }, + { startIndex: 39, type: 'annotation.wgsl' }, + { startIndex: 47, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 48, type: 'variable.predefined.wgsl' }, + { startIndex: 56, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 57, type: 'white.wgsl' }, + { startIndex: 58, type: 'variable.predefined.wgsl' }, + { startIndex: 63, type: 'white.wgsl' }, + { startIndex: 64, type: 'delimiter.curly.wgsl' } + ] + }, + { + line: ' return v;', + tokens: [ + { startIndex: 0, type: 'white.wgsl' }, + { startIndex: 2, type: 'keyword.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'identifier.wgsl' }, + { startIndex: 10, type: 'delimiter.wgsl' } + ] + }, + { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.wgsl' }] }, + { line: '', tokens: [] }, + { line: '@fragment', tokens: [{ startIndex: 0, type: 'annotation.wgsl' }] }, + { + line: 'fn fmain(@builtin(position) pos: vec4f) -> @location(0) vec4f {', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 2, type: 'white.wgsl' }, + { startIndex: 3, type: 'identifier.wgsl' }, + { startIndex: 8, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 9, type: 'annotation.wgsl' }, + { startIndex: 17, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 18, type: 'variable.predefined.wgsl' }, + { startIndex: 26, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 27, type: 'white.wgsl' }, + { startIndex: 28, type: 'identifier.wgsl' }, + { startIndex: 31, type: 'delimiter.wgsl' }, + { startIndex: 32, type: 'white.wgsl' }, + { startIndex: 33, type: 'variable.predefined.wgsl' }, + { startIndex: 38, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 39, type: 'white.wgsl' }, + { startIndex: 40, type: 'operator.wgsl' }, + { startIndex: 42, type: 'white.wgsl' }, + { startIndex: 43, type: 'annotation.wgsl' }, + { startIndex: 52, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 53, type: 'number.wgsl' }, + { startIndex: 54, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 55, type: 'white.wgsl' }, + { startIndex: 56, type: 'variable.predefined.wgsl' }, + { startIndex: 61, type: 'white.wgsl' }, + { startIndex: 62, type: 'delimiter.curly.wgsl' } + ] + }, + { + line: ' return vec4f(0.25,0.25,1.0,1.0);', + tokens: [ + { startIndex: 0, type: 'white.wgsl' }, + { startIndex: 2, type: 'keyword.wgsl' }, + { startIndex: 8, type: 'white.wgsl' }, + { startIndex: 9, type: 'variable.predefined.wgsl' }, + { startIndex: 14, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 15, type: 'number.float.wgsl' }, + { startIndex: 19, type: 'delimiter.wgsl' }, + { startIndex: 20, type: 'number.float.wgsl' }, + { startIndex: 24, type: 'delimiter.wgsl' }, + { startIndex: 25, type: 'number.float.wgsl' }, + { startIndex: 28, type: 'delimiter.wgsl' }, + { startIndex: 29, type: 'number.float.wgsl' }, + { startIndex: 32, type: 'delimiter.parenthesis.wgsl' }, + { startIndex: 33, type: 'delimiter.wgsl' } + ] + }, + { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.wgsl' }] } + ], + // type generators + [ + { + line: '// Test predeclared type generators, other than vector, matrix, and texture.', + tokens: [{ startIndex: 0, type: 'comment.wgsl' }] + }, + { + line: 'alias a=array;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'operator.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 13, type: 'operator.wgsl' }, + { startIndex: 14, type: 'variable.predefined.wgsl' }, + { startIndex: 17, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias b=atomic;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'operator.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 14, type: 'operator.wgsl' }, + { startIndex: 15, type: 'variable.predefined.wgsl' }, + { startIndex: 18, type: 'delimiter.wgsl' } + ] + }, + { + line: 'alias c=ptr;', + tokens: [ + { startIndex: 0, type: 'keyword.wgsl' }, + { startIndex: 5, type: 'white.wgsl' }, + { startIndex: 6, type: 'identifier.wgsl' }, + { startIndex: 7, type: 'operator.wgsl' }, + { startIndex: 8, type: 'variable.predefined.wgsl' }, + { startIndex: 11, type: 'operator.wgsl' }, + { startIndex: 12, type: 'variable.predefined.wgsl' }, + { startIndex: 20, type: 'delimiter.wgsl' }, + { startIndex: 21, type: 'variable.predefined.wgsl' }, + { startIndex: 24, type: 'delimiter.wgsl' } + ] + } + ] +]; +testTokenization('wgsl', cases); diff --git a/src/basic-languages/wgsl/wgsl.ts b/src/basic-languages/wgsl/wgsl.ts new file mode 100644 index 00000000..1ed58809 --- /dev/null +++ b/src/basic-languages/wgsl/wgsl.ts @@ -0,0 +1,487 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation, Google LLC. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import type { languages } from '../../fillers/monaco-editor-core'; + +export const conf: languages.LanguageConfiguration = { + comments: { + lineComment: '//', + blockComment: ['/*', '*/'] + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '[', close: ']' }, + { open: '{', close: '}' }, + { open: '(', close: ')' } + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' } + ] +}; + +// Returns a list of empty strings, from a possibly multi-line string, +// stripping blanks and line endings. Emulates Perls 'qw' function. +function qw(str: string): string[] { + let result: string[] = []; + const words = str.split(/\t+|\r+|\n+| +/); + for (let i = 0; i < words.length; ++i) { + if (words[i].length > 0) { + result.push(words[i]); + } + } + return result; +} +const atoms = qw('true false'); + +const keywords = qw(` + alias + break + case + const + const_assert + continue + continuing + default + diagnostic + discard + else + enable + fn + for + if + let + loop + override + requires + return + struct + switch + var + while + `); + +const reserved = qw(` + NULL + Self + abstract + active + alignas + alignof + as + asm + asm_fragment + async + attribute + auto + await + become + binding_array + cast + catch + class + co_await + co_return + co_yield + coherent + column_major + common + compile + compile_fragment + concept + const_cast + consteval + constexpr + constinit + crate + debugger + decltype + delete + demote + demote_to_helper + do + dynamic_cast + enum + explicit + export + extends + extern + external + fallthrough + filter + final + finally + friend + from + fxgroup + get + goto + groupshared + highp + impl + implements + import + inline + instanceof + interface + layout + lowp + macro + macro_rules + match + mediump + meta + mod + module + move + mut + mutable + namespace + new + nil + noexcept + noinline + nointerpolation + noperspective + null + nullptr + of + operator + package + packoffset + partition + pass + patch + pixelfragment + precise + precision + premerge + priv + protected + pub + public + readonly + ref + regardless + register + reinterpret_cast + require + resource + restrict + self + set + shared + sizeof + smooth + snorm + static + static_assert + static_cast + std + subroutine + super + target + template + this + thread_local + throw + trait + try + type + typedef + typeid + typename + typeof + union + unless + unorm + unsafe + unsized + use + using + varying + virtual + volatile + wgsl + where + with + writeonly + yield + `); + +const predeclared_enums = qw(` + read write read_write + function private workgroup uniform storage + perspective linear flat + center centroid sample + vertex_index instance_index position front_facing frag_depth + local_invocation_id local_invocation_index + global_invocation_id workgroup_id num_workgroups + sample_index sample_mask + rgba8unorm + rgba8snorm + rgba8uint + rgba8sint + rgba16uint + rgba16sint + rgba16float + r32uint + r32sint + r32float + rg32uint + rg32sint + rg32float + rgba32uint + rgba32sint + rgba32float + bgra8unorm +`); + +const predeclared_types = qw(` + bool + f16 + f32 + i32 + sampler sampler_comparison + texture_depth_2d + texture_depth_2d_array + texture_depth_cube + texture_depth_cube_array + texture_depth_multisampled_2d + texture_external + texture_external + u32 + `); + +const predeclared_type_generators = qw(` + array + atomic + mat2x2 + mat2x3 + mat2x4 + mat3x2 + mat3x3 + mat3x4 + mat4x2 + mat4x3 + mat4x4 + ptr + texture_1d + texture_2d + texture_2d_array + texture_3d + texture_cube + texture_cube_array + texture_multisampled_2d + texture_storage_1d + texture_storage_2d + texture_storage_2d_array + texture_storage_3d + vec2 + vec3 + vec4 + `); + +const predeclared_type_aliases = qw(` + vec2i vec3i vec4i + vec2u vec3u vec4u + vec2f vec3f vec4f + vec2h vec3h vec4h + mat2x2f mat2x3f mat2x4f + mat3x2f mat3x3f mat3x4f + mat4x2f mat4x3f mat4x4f + mat2x2h mat2x3h mat2x4h + mat3x2h mat3x3h mat3x4h + mat4x2h mat4x3h mat4x4h + `); + +const predeclared_intrinsics = qw(` + bitcast all any select arrayLength abs acos acosh asin asinh atan atanh atan2 + ceil clamp cos cosh countLeadingZeros countOneBits countTrailingZeros cross + degrees determinant distance dot exp exp2 extractBits faceForward firstLeadingBit + firstTrailingBit floor fma fract frexp inverseBits inverseSqrt ldexp length + log log2 max min mix modf normalize pow quantizeToF16 radians reflect refract + reverseBits round saturate sign sin sinh smoothstep sqrt step tan tanh transpose + trunc dpdx dpdxCoarse dpdxFine dpdy dpdyCoarse dpdyFine fwidth fwidthCoarse fwidthFine + textureDimensions textureGather textureGatherCompare textureLoad textureNumLayers + textureNumLevels textureNumSamples textureSample textureSampleBias textureSampleCompare + textureSampleCompareLevel textureSampleGrad textureSampleLevel textureSampleBaseClampToEdge + textureStore atomicLoad atomicStore atomicAdd atomicSub atomicMax atomicMin + atomicAnd atomicOr atomicXor atomicExchange atomicCompareExchangeWeak pack4x8snorm + pack4x8unorm pack2x16snorm pack2x16unorm pack2x16float unpack4x8snorm unpack4x8unorm + unpack2x16snorm unpack2x16unorm unpack2x16float storageBarrier workgroupBarrier + workgroupUniformLoad +`); + +// https://gpuweb.github.io/gpuweb/wgsl/#syntactic-token +// But skip bracket-like things, comma, colon, semicolon, underscore, at. +const operators = qw(` + & + && + -> + / + = + == + != + > + >= + < + <= + % + - + -- + + + ++ + | + || + * + << + >> + += + -= + *= + /= + %= + &= + |= + ^= + >>= + <<= + `); + +const directive_re = /enable|requires|diagnostic/; + +const ident_re = /[_\p{XID_Start}]\p{XID_Continue}*/u; + +const predefined_token = 'variable.predefined'; + +export const language = { + tokenPostfix: '.wgsl', + defaultToken: 'invalid', + unicode: true, + + atoms, + keywords, + reserved, + predeclared_enums, + predeclared_types, + predeclared_type_generators, + predeclared_type_aliases, + predeclared_intrinsics, + operators, + + symbols: /[!%&*+\-\.\/:;<=>^|_~]+/, + + tokenizer: { + root: [ + [directive_re, 'keyword', '@directive'], + [ + // Identifier-like things, but also include '_' + ident_re, + { + cases: { + '@atoms': predefined_token, + '@keywords': 'keyword', + '@reserved': 'invalid', + '@predeclared_enums': predefined_token, + '@predeclared_types': predefined_token, + '@predeclared_type_generators': predefined_token, + '@predeclared_type_aliases': predefined_token, + '@predeclared_intrinsics': predefined_token, + '@default': 'identifier' + } + } + ], + { include: '@commentOrSpace' }, + { include: '@numbers' }, + + [/;:\./, 'delimiter'], + [/,/, 'delimiter'], // Hack: Should be in previous rule + [/[{}()\[\]]/, '@brackets'], + ['@', 'annotation', '@attribute'], + [ + /@symbols/, + { + cases: { + '@operators': 'operator', + '@default': 'delimiter' + } + } + ], + [/./, 'invalid'] + ], + + commentOrSpace: [ + [/\s+/, 'white'], + [/\/\*/, 'comment', '@blockComment'], + [/\/\/.*$/, 'comment'] + ], + + blockComment: [ + // Soak up uninteresting text: anything except * or / + [/[^\/*]+/, 'comment'], + // Recognize the start of a nested block comment. + [/\/\*/, 'comment', '@push'], + // Recognize the end of a nested block comment. + [/\*\//, 'comment', '@pop'], + // Recognize insignificant * and / + [/[\/*]/, 'comment'] + ], + + attribute: [ + // For things like '@fragment' both '@' and 'fragment' + // are marked as annotations. This should work even if + // there are spaces or comments between the two tokens. + { include: '@commentOrSpace' }, + [/\w+/, 'annotation', '@pop'] + ], + + directive: [ + // For things like 'enable f16;', 'enable' maps to 'meta' + // and 'f16' maps to 'meta.tag'. + { include: '@commentOrSpace' }, + [/[()]/, '@brackets'], + [/,/, 'delimiter'], + [ident_re, 'meta.content'], + [/;/, 'delimiter', '@pop'] + ], + + numbers: [ + // Decimal float literals + // https://www.w3.org/TR/WGSL/#syntax-decimal_float_literal + // 0, with type-specifying suffix. + [/0[fh]/, 'number.float'], + // Other decimal integer, with type-specifying suffix. + [/[1-9][0-9]*[fh]/, 'number.float'], + // Has decimal point, at least one digit after decimal. + [/[0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[fh]?/, 'number.float'], + // Has decimal point, at least one digit before decimal. + [/[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?[fh]?/, 'number.float'], + // Has at least one digit, and has an exponent. + [/[0-9]+[eE][+-]?[0-9]+[fh]?/, 'number.float'], + + // Hex float literals + // https://www.w3.org/TR/WGSL/#syntax-hex_float_literal + [/0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+(?:[pP][+-]?[0-9]+[fh]?)?/, 'number.hex'], + [/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*(?:[pP][+-]?[0-9]+[fh]?)?/, 'number.hex'], + [/0[xX][0-9a-fA-F]+[pP][+-]?[0-9]+[fh]?/, 'number.hex'], + + // Hexadecimal integer literals + // https://www.w3.org/TR/WGSL/#syntax-hex_int_literal + [/0[xX][0-9a-fA-F]+[iu]?/, 'number.hex'], + + // Decimal integer literals + // https://www.w3.org/TR/WGSL/#syntax-decimal_int_literal + // We need two rules here because 01 is not valid. + [/[1-9][0-9]*[iu]?/, 'number'], + [/0[iu]?/, 'number'] // Must match last + ] + } +}; diff --git a/website/src/website/data/home-samples/sample.wgsl.txt b/website/src/website/data/home-samples/sample.wgsl.txt new file mode 100644 index 00000000..51e004b3 --- /dev/null +++ b/website/src/website/data/home-samples/sample.wgsl.txt @@ -0,0 +1,48 @@ +// A fragment shader which lights textured geometry with point lights. +// Taken from the introduction of the WebGPU Shading Lnaguage Specification +// https://w3.org/TR/WGSL + +// Lights from a storage buffer binding. +struct PointLight { + position : vec3f, + color : vec3f, +} + +struct LightStorage { + pointCount : u32, + point : array, +} +@group(0) @binding(0) var lights : LightStorage; + +// Texture and sampler. +@group(1) @binding(0) var baseColorSampler : sampler; +@group(1) @binding(1) var baseColorTexture : texture_2d; + +// Function arguments are values from from vertex shader. +@fragment +fn fragmentMain(@location(0) worldPos : vec3f, + @location(1) normal : vec3f, + @location(2) uv : vec2f) -> @location(0) vec4f { + // Sample the base color of the surface from a texture. + let baseColor = textureSample(baseColorTexture, baseColorSampler, uv); + + let N = normalize(normal); + var surfaceColor = vec3f(0); + + // Loop over the scene point lights. + for (var i = 0u; i < lights.pointCount; i++) { + let worldToLight = lights.point[i].position - worldPos; + let dist = length(worldToLight); + let dir = normalize(worldToLight); + + // Determine the contribution of this light to the surface color. + let radiance = lights.point[i].color * (1 / pow(dist, 2)); + let nDotL = max(dot(N, dir), 0); + + // Accumulate light contribution to the surface color. + surfaceColor += baseColor.rgb * radiance * nDotL; + } + + // Return the accumulated surface color. + return vec4(surfaceColor, baseColor.a); +} From 044810afa9126bcf94bb1a256066c0f484da84af Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 4 Apr 2023 10:55:43 +0200 Subject: [PATCH 06/12] 0.37.0 release --- CHANGELOG.md | 19 +++++++++++++++++++ package-lock.json | 4 ++-- package.json | 4 ++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03b07057..57537405 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Monaco Editor Changelog +## [0.37.0] + +- New `registerLinkOpener` API +- New `onLanguageEncountered` event for when a language is encountered during tokenization. +- Updated TypeScript to 5.0 +- New required field `canFormatMultipleRanges` on `DocumentRangeFormattingEditProvider` +- Bugfixes + +Contributions to `monaco-editor`: + +- [@danboo (Dan Boorstein)](https://github.com/danboo): add perl module (.pm) extension [PR #3258](https://github.com/microsoft/monaco-editor/pull/3258) +- [@miloush (Jan Kučera)](https://github.com/miloush): Include .xsd and .xslt as an XML extension [PR #3866](https://github.com/microsoft/monaco-editor/pull/3866) +- [@nnnnoel (Noel Kim (김민혁))](https://github.com/nnnnoel): Add CommonJS, ESM extension for TS [PR #3264](https://github.com/microsoft/monaco-editor/pull/3264) +- [@PmcFizz (Fizz)](https://github.com/PmcFizz): opt example [PR #3726](https://github.com/microsoft/monaco-editor/pull/3726) +- [@tamayika](https://github.com/tamayika) + - Fix playground samples type errors and add CI test [PR #3722](https://github.com/microsoft/monaco-editor/pull/3722) + - Add custom keybinding example [PR #3848](https://github.com/microsoft/monaco-editor/pull/3848) +- [@yuri1969 (yuri)](https://github.com/yuri1969): Various YAML improvements [PR #3864](https://github.com/microsoft/monaco-editor/pull/3864) + ## [0.36.1] - Marks unneeded dependencies as dev dependencies. diff --git a/package-lock.json b/package-lock.json index 15de8814..13ca73e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "monaco-editor", - "version": "0.36.1", + "version": "0.37.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "monaco-editor", - "version": "0.36.1", + "version": "0.37.0", "hasInstallScript": true, "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index 0bd0cd9b..a89e1b53 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "monaco-editor", - "version": "0.36.1", - "vscodeRef": "07d120e10a4d3ac790e65b8a6dc85195546df664", + "version": "0.37.0", + "vscodeRef": "9eba21c20f8720575cbc6c531d60c042c554d465", "private": true, "description": "A browser based code editor", "homepage": "https://github.com/microsoft/monaco-editor", From 6c77360f6b8dd9ee7ea07b67f9a6a9c540100ed9 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 4 Apr 2023 11:00:31 +0200 Subject: [PATCH 07/12] Sets tsc target to fix playground compile issues --- website/scripts/check-playground-samples-js.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/scripts/check-playground-samples-js.ts b/website/scripts/check-playground-samples-js.ts index dffcc62e..b0fa28c4 100644 --- a/website/scripts/check-playground-samples-js.ts +++ b/website/scripts/check-playground-samples-js.ts @@ -14,6 +14,8 @@ import { exit } from "process"; "yarn", [ "tsc", + "--target", + "es6", "--noEmit", "--allowJs", "--checkJs", From e8e3ac9ac1235b20089072b41326c57c34dc4e2a Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 4 Apr 2023 15:41:55 +0200 Subject: [PATCH 08/12] Updates playwright --- package-lock.json | 502 ++-------------------------------------------- package.json | 2 +- 2 files changed, 20 insertions(+), 484 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13ca73e4..081ac824 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "monaco-editor-core": "^0.37.0-dev.20230403", "parcel": "^2.7.0", "pin-github-action": "^1.8.0", - "playwright": "^1.18.1", + "playwright": "^1.32.2", "prettier": "^2.5.1", "pretty-quick": "^3.1.3", "requirejs": "^2.3.6", @@ -1842,16 +1842,6 @@ "@types/node": "*" } }, - "node_modules/@types/yauzl": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz", - "integrity": "sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==", - "dev": true, - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@typescript/vfs": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.3.5.tgz", @@ -2360,15 +2350,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -2578,15 +2559,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -3828,26 +3800,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3866,15 +3818,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, "node_modules/file-loader": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", @@ -4414,12 +4357,6 @@ "node": ">= 0.10" } }, - "node_modules/ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "dev": true - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -4563,12 +4500,6 @@ "node": ">= 10.13.0" } }, - "node_modules/jpeg-js": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", - "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", - "dev": true - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5010,18 +4941,6 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/mime-db": { "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", @@ -5608,12 +5527,6 @@ "node": "*" } }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true - }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -5667,79 +5580,31 @@ } }, "node_modules/playwright": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.18.1.tgz", - "integrity": "sha512-8EaX9EtbtAoMq5tnzIsoA3b/V86V/6Mq2skuOU4qEw+5OVxs1lwesDwmjy/RVU1Qfx5UuwSQzhp45wyH22oa+A==", + "version": "1.32.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.32.2.tgz", + "integrity": "sha512-jHVnXJke0PXpuPszKtk9y1zZSlzO5+2a+aockT/AND0oeXx46FiJEFrafthurglLygVZA+1gEbtUM1C7qtTV+Q==", "dev": true, "hasInstallScript": true, "dependencies": { - "playwright-core": "=1.18.1" + "playwright-core": "1.32.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=12" + "node": ">=14" } }, - "node_modules/playwright/node_modules/playwright-core": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.18.1.tgz", - "integrity": "sha512-NALGl8R1GHzGLlhUApmpmfh6M1rrrPcDTygWvhTbprxwGB9qd/j9DRwyn4HTQcUB6o0/VOpo46fH9ez3+D/Rog==", + "node_modules/playwright-core": { + "version": "1.32.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.2.tgz", + "integrity": "sha512-zD7aonO+07kOTthsrCR3YCVnDcqSHIJpdFUtZEMOb6//1Rc7/6mZDRdw+nlzcQiQltOOsiqI3rrSyn/SlyjnJQ==", "dev": true, - "dependencies": { - "commander": "^8.2.0", - "debug": "^4.1.1", - "extract-zip": "^2.0.1", - "https-proxy-agent": "^5.0.0", - "jpeg-js": "^0.4.2", - "mime": "^2.4.6", - "pngjs": "^5.0.0", - "progress": "^2.0.3", - "proper-lockfile": "^4.1.1", - "proxy-from-env": "^1.1.0", - "rimraf": "^3.0.2", - "socks-proxy-agent": "^6.1.0", - "stack-utils": "^2.0.3", - "ws": "^7.4.6", - "yauzl": "^2.10.0", - "yazl": "^2.5.1" - }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=12" - } - }, - "node_modules/playwright/node_modules/ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", - "dev": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/pngjs": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", - "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", - "dev": true, - "engines": { - "node": ">=10.13.0" + "node": ">=14" } }, "node_modules/portfinder": { @@ -6049,32 +5914,6 @@ "node": ">=8" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/proper-lockfile": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", - "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "retry": "^0.12.0", - "signal-exit": "^3.0.2" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true - }, "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -6223,30 +6062,6 @@ "node": ">=4" } }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rollup": { "version": "2.79.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", @@ -6406,44 +6221,6 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "dev": true, - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", - "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", - "dev": true, - "dependencies": { - "ip": "^1.1.5", - "smart-buffer": "^4.1.0" - }, - "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks-proxy-agent": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz", - "integrity": "sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew==", - "dev": true, - "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.1", - "socks": "^2.6.1" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -6479,27 +6256,6 @@ "deprecated": "Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility", "dev": true }, - "node_modules/stack-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", - "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -7428,25 +7184,6 @@ "yaserver": "bin/yaserver" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "node_modules/yazl": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", - "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3" - } - }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -8719,16 +8456,6 @@ "@types/node": "*" } }, - "@types/yauzl": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz", - "integrity": "sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==", - "dev": true, - "optional": true, - "requires": { - "@types/node": "*" - } - }, "@typescript/vfs": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.3.5.tgz", @@ -9160,12 +8887,6 @@ "update-browserslist-db": "^1.0.9" } }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", - "dev": true - }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -9314,12 +9035,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "dev": true - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -10048,18 +9763,6 @@ "strip-final-newline": "^2.0.0" } }, - "extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "requires": { - "@types/yauzl": "^2.9.1", - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - } - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -10078,15 +9781,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "dev": true, - "requires": { - "pend": "~1.2.0" - } - }, "file-loader": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", @@ -10432,12 +10126,6 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, - "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "dev": true - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -10542,12 +10230,6 @@ "supports-color": "^8.0.0" } }, - "jpeg-js": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", - "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -10825,12 +10507,6 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true - }, "mime-db": { "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", @@ -11270,12 +10946,6 @@ "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true - }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -11316,51 +10986,18 @@ } }, "playwright": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.18.1.tgz", - "integrity": "sha512-8EaX9EtbtAoMq5tnzIsoA3b/V86V/6Mq2skuOU4qEw+5OVxs1lwesDwmjy/RVU1Qfx5UuwSQzhp45wyH22oa+A==", + "version": "1.32.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.32.2.tgz", + "integrity": "sha512-jHVnXJke0PXpuPszKtk9y1zZSlzO5+2a+aockT/AND0oeXx46FiJEFrafthurglLygVZA+1gEbtUM1C7qtTV+Q==", "dev": true, "requires": { - "playwright-core": "=1.18.1" - }, - "dependencies": { - "playwright-core": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.18.1.tgz", - "integrity": "sha512-NALGl8R1GHzGLlhUApmpmfh6M1rrrPcDTygWvhTbprxwGB9qd/j9DRwyn4HTQcUB6o0/VOpo46fH9ez3+D/Rog==", - "dev": true, - "requires": { - "commander": "^8.2.0", - "debug": "^4.1.1", - "extract-zip": "^2.0.1", - "https-proxy-agent": "^5.0.0", - "jpeg-js": "^0.4.2", - "mime": "^2.4.6", - "pngjs": "^5.0.0", - "progress": "^2.0.3", - "proper-lockfile": "^4.1.1", - "proxy-from-env": "^1.1.0", - "rimraf": "^3.0.2", - "socks-proxy-agent": "^6.1.0", - "stack-utils": "^2.0.3", - "ws": "^7.4.6", - "yauzl": "^2.10.0", - "yazl": "^2.5.1" - } - }, - "ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", - "dev": true, - "requires": {} - } + "playwright-core": "1.32.2" } }, - "pngjs": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", - "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "playwright-core": { + "version": "1.32.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.2.tgz", + "integrity": "sha512-zD7aonO+07kOTthsrCR3YCVnDcqSHIJpdFUtZEMOb6//1Rc7/6mZDRdw+nlzcQiQltOOsiqI3rrSyn/SlyjnJQ==", "dev": true }, "portfinder": { @@ -11579,29 +11216,6 @@ } } }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "proper-lockfile": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", - "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4", - "retry": "^0.12.0", - "signal-exit": "^3.0.2" - } - }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -11713,21 +11327,6 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "rollup": { "version": "2.79.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", @@ -11836,33 +11435,6 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "dev": true - }, - "socks": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", - "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", - "dev": true, - "requires": { - "ip": "^1.1.5", - "smart-buffer": "^4.1.0" - } - }, - "socks-proxy-agent": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz", - "integrity": "sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew==", - "dev": true, - "requires": { - "agent-base": "^6.0.2", - "debug": "^4.3.1", - "socks": "^2.6.1" - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -11891,23 +11463,6 @@ "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", "dev": true }, - "stack-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", - "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", - "dev": true, - "requires": { - "escape-string-regexp": "^2.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - } - } - }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -12545,25 +12100,6 @@ "integrity": "sha512-98Vj4sgqB1fLcpf2wK7h3dFCaabISHU9CXZHaAx3QLkvTTCD31MzMcNbw5V5jZFBK7ffkFqfWig6B20KQt4wtA==", "dev": true }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "dev": true, - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "yazl": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", - "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", - "dev": true, - "requires": { - "buffer-crc32": "~0.2.3" - } - }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/package.json b/package.json index a89e1b53..2696fdf5 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "monaco-editor-core": "^0.37.0-dev.20230403", "parcel": "^2.7.0", "pin-github-action": "^1.8.0", - "playwright": "^1.18.1", + "playwright": "^1.32.2", "prettier": "^2.5.1", "pretty-quick": "^3.1.3", "requirejs": "^2.3.6", From 29bf7f9a9192158d0258cee2c2e12d9e9d8b0adf Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Wed, 5 Apr 2023 12:22:20 +0200 Subject: [PATCH 09/12] Implements option to disable auto-reload --- .../pages/playground/PlaygroundModel.ts | 19 ++++++++++++++- .../playground/PlaygroundPageContent.tsx | 24 ++++++++++++++++--- .../website/pages/playground/SettingsModel.ts | 10 ++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/website/src/website/pages/playground/PlaygroundModel.ts b/website/src/website/pages/playground/PlaygroundModel.ts index 15ae15f8..5f8bdc15 100644 --- a/website/src/website/pages/playground/PlaygroundModel.ts +++ b/website/src/website/pages/playground/PlaygroundModel.ts @@ -56,7 +56,7 @@ export class PlaygroundModel { public readonly serializer = new StateUrlSerializer(this); - reload(): void { + public reload(): void { this.reloadKey++; } @@ -127,12 +127,29 @@ export class PlaygroundModel { private readonly debouncer = new Debouncer(250); + @observable + public isDirty = false; + constructor() { + let lastState = this.state; + this.dispose.track({ dispose: reaction( () => ({ state: this.state }), ({ state }) => { + if (!this.settings.autoReload) { + if ( + JSON.stringify(state.monacoSetup) === + JSON.stringify(lastState.monacoSetup) && + state.key === lastState.key + ) { + this.isDirty = true; + return; + } + } this.debouncer.run(() => { + this.isDirty = false; + lastState = state; for (const handler of this._previewHandlers) { handler.handlePreview(state); } diff --git a/website/src/website/pages/playground/PlaygroundPageContent.tsx b/website/src/website/pages/playground/PlaygroundPageContent.tsx index 7968b323..20eca186 100644 --- a/website/src/website/pages/playground/PlaygroundPageContent.tsx +++ b/website/src/website/pages/playground/PlaygroundPageContent.tsx @@ -18,7 +18,7 @@ import { PlaygroundModel } from "./PlaygroundModel"; import { Preview } from "./Preview"; import { SettingsDialog } from "./SettingsDialog"; import { Button, Col, Row, Stack } from "../../components/bootstrap"; -import { ButtonGroup } from "react-bootstrap"; +import { ButtonGroup, FormCheck } from "react-bootstrap"; @hotComponent(module) @observer @@ -114,11 +114,29 @@ export class PlaygroundPageContent extends React.Component< titleBarItems={
+ {model.settings.previewFullScreen || ( + + (model.settings.autoReload = + e.target.checked) + } + /> + )}
+ } + > + + + -
- - - -
+
+ + + +
-
- - - -
- - +
+ + + +
+ + + )} Date: Wed, 5 Apr 2023 17:50:32 +0200 Subject: [PATCH 11/12] 0.37.1 --- CHANGELOG.md | 4 ++++ package.json | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57537405..b4a60415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Monaco Editor Changelog +## [0.37.1] + +- Fixes Inline Completions feature + ## [0.37.0] - New `registerLinkOpener` API diff --git a/package.json b/package.json index 2696fdf5..68fb1602 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "monaco-editor", - "version": "0.37.0", - "vscodeRef": "9eba21c20f8720575cbc6c531d60c042c554d465", + "version": "0.37.1", + "vscodeRef": "8f74fbfd1f2d8f6268a42df131726b218aafe511", "private": true, "description": "A browser based code editor", "homepage": "https://github.com/microsoft/monaco-editor", From e3b1a47554b8ec6282f02d0d537cf7e1777e8983 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 6 Apr 2023 16:30:30 +0200 Subject: [PATCH 12/12] Playground improvements --- .../website/pages/playground/PlaygroundModel.ts | 2 +- .../pages/playground/PlaygroundPageContent.tsx | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/website/src/website/pages/playground/PlaygroundModel.ts b/website/src/website/pages/playground/PlaygroundModel.ts index d94a9988..7cb6cbf0 100644 --- a/website/src/website/pages/playground/PlaygroundModel.ts +++ b/website/src/website/pages/playground/PlaygroundModel.ts @@ -140,7 +140,7 @@ export class PlaygroundModel { } } - private readonly debouncer = new Debouncer(250); + private readonly debouncer = new Debouncer(700); @observable public isDirty = false; diff --git a/website/src/website/pages/playground/PlaygroundPageContent.tsx b/website/src/website/pages/playground/PlaygroundPageContent.tsx index e93c0d4a..3c1039d5 100644 --- a/website/src/website/pages/playground/PlaygroundPageContent.tsx +++ b/website/src/website/pages/playground/PlaygroundPageContent.tsx @@ -133,10 +133,16 @@ export class PlaygroundPageContent extends React.Component< checked={ model.settings.autoReload } - onChange={(e) => - (model.settings.autoReload = - e.target.checked) - } + onChange={(e) => { + model.settings.autoReload = + e.target.checked; + if ( + e.target.checked && + model.isDirty + ) { + model.reload(); + } + }} /> )}