mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
[glsl-in] require at least one item inside struct_declaration_list
This commit is contained in:
1 parent
b261dde77f
commit
f85c896ddf
2 files changed
+13
-4
No files matched your search
@@ -860,10 +860,6 @@ impl<'source, 'program, 'options> Parser<'source, 'program, 'options> {
|
||||
let mut span = 0;
|
||||
|
||||
loop {
|
||||
if let TokenValue::RightBrace = self.expect_peek()?.value {
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO: type_qualifier
|
||||
|
||||
let ty = self.parse_type_non_void()?.0;
|
||||
@@ -884,6 +880,10 @@ impl<'source, 'program, 'options> Parser<'source, 'program, 'options> {
|
||||
span += self.program.module.types[ty]
|
||||
.inner
|
||||
.span(&self.program.module.constants);
|
||||
|
||||
if let TokenValue::RightBrace = self.expect_peek()?.value {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(span)
|
||||
|
||||
@@ -507,4 +507,13 @@ fn structs() {
|
||||
&entry_points,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
parse_program(
|
||||
r#"
|
||||
# version 450
|
||||
struct Test {};
|
||||
"#,
|
||||
&entry_points,
|
||||
)
|
||||
.unwrap_err();
|
||||
}
|
||||
Reference in new issue
Block a user