aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorStanisław Zagórowski <hasohasacz@gmail.com>2024-01-11 15:29:25 +0100
committerStanisław Zagórowski <hasohasacz@gmail.com>2024-01-11 15:29:25 +0100
commit8d9e00edacbc061ec5efba100e2af71be6824af8 (patch)
tree3f03f5a11a3a4e1ee804bc4b55e29a867a9db563 /src/error.rs
parent343bcfdfaaba32b7a46e1a945a4538e72d166ea8 (diff)
luax
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/error.rs b/src/error.rs
index 39c8cce..51803c7 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -4,16 +4,13 @@ use std::fmt::{self, Display, Formatter};
pub enum LuaXError {
InvalidStart, // used internally
MissingField(String),
- WrongFieldType(String),
NonTableChildren,
+ NonTableAttrs,
UnexpectedCharacter(char),
- UnexpectedToken(String),
NeededToken(String),
ExpectedVar,
ExpectedExpression,
UnterminatedStringLiteral,
- InvalidEscapeSequence(char),
- InvalidAssignmentTarget,
}
impl std::error::Error for LuaXError {}
@@ -23,16 +20,13 @@ impl Display for LuaXError {
match self {
LuaXError::InvalidStart => write!(f, "Invalid start"),
LuaXError::MissingField(field) => write!(f, "Missing required field: {}", field),
- LuaXError::WrongFieldType(field) => write!(f, "Wrong field type: field {}", field),
LuaXError::NonTableChildren => write!(f, "Children must be tables"),
+ LuaXError::NonTableAttrs => write!(f, "Attrs must be tables"),
LuaXError::UnexpectedCharacter(c) => write!(f, "Unexpected character: '{}'", c),
- LuaXError::UnexpectedToken(token) => write!(f, "Unexpected token: {}", token),
LuaXError::NeededToken(token) => write!(f, "Needed token: {}", token),
LuaXError::ExpectedVar => write!(f, "Expected variable"),
LuaXError::ExpectedExpression => write!(f, "Expected expression"),
LuaXError::UnterminatedStringLiteral => write!(f, "Unterminated string literal"),
- LuaXError::InvalidEscapeSequence(c) => write!(f, "Invalid escape sequence: {}", c),
- LuaXError::InvalidAssignmentTarget => write!(f, "Invalid assignment target"),
}
}
}