Skip to content

Commit

Permalink
feat(wgsl-in): add unimpl. diag. for compound stmt. @diagnostic(…)s
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Nov 5, 2024
1 parent 800719a commit b52ee7c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions naga/src/front/wgsl/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2159,6 +2159,21 @@ impl Parser {

ctx.local_table.push_scope();

while lexer.skip(Token::Attribute) {
let (name, name_span) = lexer.next_ident_with_span()?;
if let Some(DirectiveKind::Diagnostic) = DirectiveKind::from_ident(name) {
return Err(Error::DiagnosticNotYetImplementedAtParseSite {
site_name_plural: "compound statements",
span: name_span,
});
} else {
return Err(Error::Unexpected(
name_span,
ExpectedToken::DiagnosticAttribute,
));
}
}

let brace_span = lexer.expect_span(Token::Paren('{'))?;
let brace_nesting_level = Self::increase_brace_nesting(brace_nesting_level, brace_span)?;
let mut block = ast::Block::default();
Expand Down

0 comments on commit b52ee7c

Please sign in to comment.