Skip to content

Commit

Permalink
[naga/wgsl-in] allow reserved ident __naga_polyfill_
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Oct 10, 2024
1 parent e1dd3a3 commit c4b141c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions naga/src/front/wgsl/parse/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ impl<'a> Lexer<'a> {
) -> Result<(&'a str, Span), Error<'a>> {
match self.next() {
(Token::Word("_"), span) => Err(Error::InvalidIdentifierUnderscore(span)),
(Token::Word(word), span) if word.starts_with("__naga_polyfill_") => Ok((word, span)),
(Token::Word(word), span) if word.starts_with("__") => {
Err(Error::ReservedIdentifierPrefix(span))
}
Expand Down

0 comments on commit c4b141c

Please sign in to comment.