pub enum A2lError {
Show 13 variants
UnterminatedString {
line: usize,
},
UnterminatedComment {
line: usize,
},
InvalidNumber {
text: String,
line: usize,
},
InvalidAddress {
value: f64,
line: usize,
},
UnexpectedEof {
context: &'static str,
},
UnexpectedToken {
expected: &'static str,
got: String,
line: usize,
},
InvalidDatatype {
text: String,
line: usize,
},
InvalidCharType {
text: String,
line: usize,
},
InvalidConversionType {
text: String,
line: usize,
},
UnterminatedBlock {
block: String,
line: usize,
},
BlockMismatch {
opened: String,
closed: String,
line: usize,
},
MissingProject,
DepthLimitExceeded {
line: usize,
},
}Expand description
The single crate-level error for lexing and parsing.
Variants§
UnterminatedString
A quoted string runs to end of input without a closing quote.
UnterminatedComment
A /* */ comment runs to end of input without */.
InvalidNumber
A numeric literal is not a valid number (includes hex literals with bad digits and malformed floats).
InvalidAddress
A number that must be a 32-bit ECU address is negative or exceeds
u32::MAX.
UnexpectedEof
Input ended where a token was required.
UnexpectedToken
A token of a different kind appeared where one was required.
Fields
InvalidDatatype
A DATATYPE keyword outside the ASAP2 data-type set.
InvalidCharType
A CHARACTERISTIC type keyword outside the ASAP2 set (VALUE, CURVE, MAP, VAL_BLK, ASCII).
InvalidConversionType
A COMPU_METHOD conversion type outside the supported set (RAT_FUNC, LINEAR, TABLE, IDENTITY/IDENTICAL).
UnterminatedBlock
A /begin NAME block ran to end of input without its /end NAME.
BlockMismatch
A /end NAME closed a different block than the innermost open one.
Fields
MissingProject
No /begin PROJECT block was found at the top level.
DepthLimitExceeded
/begin blocks nested deeper than the parser’s limit
(MAX_DEPTH) — a guard against pathological
input, never triggered by conforming files.
Implementations§
Trait Implementations§
Source§impl Error for A2lError
impl Error for A2lError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()