Skip to content

Commit

Permalink
Allow comma or no flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vecvec committed Feb 14, 2025
1 parent dd46ed4 commit 78155a5
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions naga/src/front/wgsl/parse/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,16 +465,20 @@ impl<'a> Lexer<'a> {
pub(in crate::front::wgsl) fn next_acceleration_structure_flags(
&mut self,
) -> Result<bool, Error<'a>> {
Ok(if self.peek().0 == Token::Paren('<') {
self.expect(Token::Paren('<'))?;
let (name, span) = self.next_ident_with_span()?;
let ret = if name == "vertex_return" {
true
Ok(if self.skip(Token::Paren('<')) {
if !self.skip(Token::Paren('>')) {
let (name, span) = self.next_ident_with_span()?;
let ret = if name == "vertex_return" {
true
} else {
return Err(Error::UnknownAttribute(span));
};
self.skip(Token::Separator(','));
self.expect(Token::Paren('>'))?;
ret
} else {
return Err(Error::UnknownAttribute(span));
};
self.expect(Token::Paren('>'))?;
ret
false
}
} else {
false
})
Expand Down

0 comments on commit 78155a5

Please sign in to comment.