From fb47a0f545b1e28a739cdb37e8156f4b41ee1a76 Mon Sep 17 00:00:00 2001 From: David Neto Date: Tue, 4 Apr 2023 10:13:10 -0400 Subject: [PATCH] Avoid a hack in the WGSL lexer This is a non-functioal change. The current rule for delimiters was silly: it should have been a character class range (e.g. [ ... ]). Move delimiter handling into the symbols matcher. --- src/basic-languages/wgsl/wgsl.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/basic-languages/wgsl/wgsl.ts b/src/basic-languages/wgsl/wgsl.ts index 1ed58809..ab3a4822 100644 --- a/src/basic-languages/wgsl/wgsl.ts +++ b/src/basic-languages/wgsl/wgsl.ts @@ -377,7 +377,7 @@ export const language = { predeclared_intrinsics, operators, - symbols: /[!%&*+\-\.\/:;<=>^|_~]+/, + symbols: /[!%&*+\-\.\/:;<=>^|_~,]+/, tokenizer: { root: [ @@ -402,8 +402,6 @@ export const language = { { include: '@commentOrSpace' }, { include: '@numbers' }, - [/;:\./, 'delimiter'], - [/,/, 'delimiter'], // Hack: Should be in previous rule [/[{}()\[\]]/, '@brackets'], ['@', 'annotation', '@attribute'], [