pub enum ErrorKind {
Show 33 variants
UnexpectedChar(char),
UnexpectedToken(String),
InvalidBitPattern(String),
ExpectedToken(String),
InvalidRange,
InvalidWidth(u32),
MissingDecoderBlock,
DuplicateInstructionName(String),
DuplicateTypeAlias(String),
BitCoverageGap {
instruction: String,
missing_bits: Vec<u32>,
},
OverlappingBits {
instruction: String,
bit: u32,
},
UnresolvedType(String),
PatternConflict {
a: String,
b: String,
},
PatternLengthMismatch {
instruction: String,
expected: u32,
got: u32,
},
UnusedImport(String),
InvalidFormatString(String),
InvalidGuard(String),
UndefinedFieldInFormat {
instruction: String,
field: String,
},
UndefinedFieldInGuard {
instruction: String,
field: String,
},
UndefinedMap(String),
MapArgCountMismatch {
map: String,
expected: usize,
got: usize,
},
DuplicateMapEntry {
map: String,
},
DuplicateMapName(String),
UnguardedNonLastFormatLine {
instruction: String,
},
UnknownBuiltinFunction(String),
CrossUnitBoundary {
instruction: String,
range_start: u32,
range_end: u32,
width: u32,
},
ExceedsMaxUnits {
instruction: String,
required: u32,
max_units: u32,
},
InconsistentFragmentNames {
subdecoder: String,
instruction: String,
expected: Vec<String>,
got: Vec<String>,
},
SubDecoderFieldTooWide {
field: String,
field_width: u32,
subdecoder: String,
subdecoder_width: u32,
},
UndefinedSubDecoder(String),
UndefinedFragment {
subdecoder: String,
fragment: String,
},
CircularInclude(String),
IncludeNotFound(String),
}Expand description
Kinds of errors that can occur during parsing and validation.
Variants§
UnexpectedChar(char)
Unexpected character in input
UnexpectedToken(String)
Unexpected token
InvalidBitPattern(String)
Invalid bit pattern syntax
ExpectedToken(String)
Expected token missing
InvalidRange
Invalid bit range specification
InvalidWidth(u32)
Invalid decoder width value
MissingDecoderBlock
Missing decoder block in definition
DuplicateInstructionName(String)
Two instructions have the same name
DuplicateTypeAlias(String)
Two type aliases have the same name
BitCoverageGap
Instruction doesn’t specify bits for all positions
OverlappingBits
Instruction specifies overlapping bits
UnresolvedType(String)
Field references an undefined type
PatternConflict
Two instructions have the same fixed bit pattern
PatternLengthMismatch
Fixed bit pattern length doesn’t match range width
UnusedImport(String)
An import statement is unused
InvalidFormatString(String)
Invalid format string syntax
InvalidGuard(String)
Invalid guard condition syntax
UndefinedFieldInFormat
Format string references undefined field
UndefinedFieldInGuard
Guard references undefined field
UndefinedMap(String)
Map call references undefined map
MapArgCountMismatch
Map call has wrong number of arguments
DuplicateMapEntry
Duplicate entry in a map
DuplicateMapName(String)
Duplicate map name
UnguardedNonLastFormatLine
Non-last format line without a guard condition
UnknownBuiltinFunction(String)
Unknown builtin function name
CrossUnitBoundary
A bit range spans across unit boundaries
ExceedsMaxUnits
Instruction requires more units than max_units allows
InconsistentFragmentNames
Fragment names differ between instructions in the same sub-decoder
SubDecoderFieldTooWide
Field bit-width exceeds sub-decoder’s declared width
UndefinedSubDecoder(String)
Referenced sub-decoder doesn’t exist
UndefinedFragment
Dotted access to a non-existent fragment name
CircularInclude(String)
Circular include detected
IncludeNotFound(String)
Included file not found