1
0
Эх сурвалжийг харах

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.
David Neto 2 жил өмнө
parent
commit
fb47a0f545

+ 1 - 3
src/basic-languages/wgsl/wgsl.ts

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