mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
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.
This commit is contained in:
committed by
Dzmitry Malyshau
parent
cf62dc3d8c
commit
1acd12334a
@@ -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)
|
||||
}
|
||||
'"' => {
|
||||
|
||||
Reference in New Issue
Block a user