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.
pull/3887/head
David Neto 2023-04-04 10:13:10 -04:00
parent 14a92401d7
commit fb47a0f545
1 changed files with 1 additions and 3 deletions

View File

@ -377,7 +377,7 @@ export const language = <languages.IMonarchLanguage>{
predeclared_intrinsics,
operators,
symbols: /[!%&*+\-\.\/:;<=>^|_~]+/,
symbols: /[!%&*+\-\.\/:;<=>^|_~,]+/,
tokenizer: {
root: [
@ -402,8 +402,6 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@commentOrSpace' },
{ include: '@numbers' },
[/;:\./, 'delimiter'],
[/,/, 'delimiter'], // Hack: Should be in previous rule
[/[{}()\[\]]/, '@brackets'],
['@', 'annotation', '@attribute'],
[