mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
glsl: Replace todo!() with a NotImplemented error
So we can get a source location rather than a panic.
This commit is contained in:
committed by
João Capucho
parent
8729391e53
commit
dd791a26ae
@@ -58,8 +58,8 @@ pub enum ErrorKind {
|
||||
InvalidVersion(SourceMetadata, u64),
|
||||
#[error("Expected {}, found {0}", join_with_comma(.1))]
|
||||
InvalidToken(Token, Vec<ExpectedToken>),
|
||||
#[error("Not implemented {0}")]
|
||||
NotImplemented(&'static str),
|
||||
#[error("Not implemented: {1}")]
|
||||
NotImplemented(SourceMetadata, &'static str),
|
||||
#[error("Unknown variable: {1}")]
|
||||
UnknownVariable(SourceMetadata, String),
|
||||
#[error("Unknown type: {1}")]
|
||||
@@ -82,6 +82,7 @@ impl ErrorKind {
|
||||
ErrorKind::UnknownVariable(metadata, _)
|
||||
| ErrorKind::InvalidProfile(metadata, _)
|
||||
| ErrorKind::InvalidVersion(metadata, _)
|
||||
| ErrorKind::NotImplemented(metadata, _)
|
||||
| ErrorKind::UnknownLayoutQualifier(metadata, _)
|
||||
| ErrorKind::SemanticError(metadata, _)
|
||||
| ErrorKind::UnknownField(metadata, _) => Some(metadata),
|
||||
|
||||
@@ -797,7 +797,10 @@ impl<'source, 'program, 'options> Parser<'source, 'program, 'options> {
|
||||
//TODO: declaration
|
||||
// type_qualifier IDENTIFIER SEMICOLON
|
||||
// type_qualifier IDENTIFIER identifier_list SEMICOLON
|
||||
todo!()
|
||||
Err(ErrorKind::NotImplemented(
|
||||
token.meta,
|
||||
"variable qualifier",
|
||||
))
|
||||
}
|
||||
}
|
||||
TokenValue::Semicolon => {
|
||||
|
||||
Reference in New Issue
Block a user