From 1acd12334aa588f30501c74dd0615e98df55a864 Mon Sep 17 00:00:00 2001 From: LaughingMan Date: Sun, 5 Jul 2020 08:23:56 +0200 Subject: [PATCH] WGSL front end: Only accept ASCII chars in identifiers Previously the lexer would accept any alphanumeric character as part of an identifier. The spec only allowes identifiers to consist of ASCII alphanumeric characters though. --- src/front/wgsl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/front/wgsl.rs b/src/front/wgsl.rs index 9ee23376a8..3b5b1a5003 100644 --- a/src/front/wgsl.rs +++ b/src/front/wgsl.rs @@ -89,7 +89,7 @@ mod lex { (Token::Number(number), rest) } 'a'..='z' | 'A'..='Z' | '_' => { - let (word, rest) = consume_any(input, |c| c.is_alphanumeric() || c == '_'); + let (word, rest) = consume_any(input, |c| c.is_ascii_alphanumeric() || c == '_'); (Token::Word(word), rest) } '"' => {