From 15e911fe3805117920eebf662461ecc20049cf08 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Mon, 4 Nov 2024 17:02:21 -0500 Subject: [PATCH] =?UTF-8?q?feat(wgsl-in):=20add=20unimpl.=20diag.=20for=20?= =?UTF-8?q?compound=20stmt.=20`@diagnostic(=E2=80=A6)`s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- naga/src/front/wgsl/parse/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/naga/src/front/wgsl/parse/mod.rs b/naga/src/front/wgsl/parse/mod.rs index 65e5cbcf1b..e4e48ad4a4 100644 --- a/naga/src/front/wgsl/parse/mod.rs +++ b/naga/src/front/wgsl/parse/mod.rs @@ -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();