Enum mm0b_parser::ParseError[][src]

pub enum ParseError {
Show 21 variants BadProofLen(usize), StmtCmdConv(u8), ProofCmdConv(u8u32), UnifyCmdConv(u8u32), Trace(&'static stru32Box<ParseError>), Exhausted(&'static stru32), BadMagic { parsed_magic: [u8; 4], }, Unaligned, SuspectHeader, IncompleteHeader { file_len: usize, }, BadVersion { parsed_version: u8, }, BadSorts(Range<usize>), BadTerms(Range<usize>), BadThms(Range<usize>), BadProofs(Range<usize>), BadIndexParse { p_index: usize, }, DuplicateIndexTable { p_index: usize, id: [u8; 4], }, BadIndexLookup { p_index: Option<usize>, }, SorryError, StrError(&'static strusize), IoError(Error),
}
Expand description

An error during parsing of an MMB file.

Variants

BadProofLen(usize)

If a malformed mmb file tries to sneak in a declar with a (cmd, data) pair whose data is a 0, try_next_decl will loop forever.

Tuple Fields of BadProofLen

0: usize
StmtCmdConv(u8)

The u8 could not be converted to a StmtCmd via TryFrom

Tuple Fields of StmtCmdConv

0: u8
ProofCmdConv(u8u32)

The pair could not be converted to a ProofCmd via TryFrom

Tuple Fields of ProofCmdConv

0: u81: u32
UnifyCmdConv(u8u32)

The pair could not be converted to a UnifyCmd via TryFrom

Tuple Fields of UnifyCmdConv

0: u81: u32
Trace(&'static stru32Box<ParseError>)

Wrap other errors to allow for some backtracing.

Tuple Fields of Trace

0: &'static str1: u322: Box<ParseError>
Exhausted(&'static stru32)

Something using an mmb file unexpectedly exhausted its input source.

Tuple Fields of Exhausted

0: &'static str1: u32
BadMagic

The parser wasn’t able to find the mmb magic number in the expected location.

Fields of BadMagic

parsed_magic: [u8; 4]

The magic value that we actually found

Unaligned

The file is not aligned to a multiple of 8 bytes, which is required for parsing the term table. (This is generally true automatically for buffers sourced from a file or mmap, but it has to be explicitly ensured in unit tests.)

SuspectHeader

The header parsed “correctly”, but the data in the header indicates that either the header’s numbers are off, or the rest of the MMB file is bad. For example, a header stating that the term declarations begin at a position greater than the length of the MMB file.

IncompleteHeader

Used in cases where the parser fails trying to get the header, because there were too few bytes in the file to form a full header. Users might like to know how long the actual file was, just as a sanity check.

Fields of IncompleteHeader

file_len: usize

The file length

BadVersion

The version is unrecognized.

Fields of BadVersion

parsed_version: u8

The MMB file version, greater than MM0B_VERSION

BadSorts(Range<usize>)

The portion of the mmb file that’s supposed to contain sorts was malformed.

Tuple Fields of BadSorts

0: Range<usize>
BadTerms(Range<usize>)

The portion of the mmb file that’s supposed to contain terms was malformed.

Tuple Fields of BadTerms

0: Range<usize>
BadThms(Range<usize>)

The portion of the mmb file that’s supposed to contain thms was malformed.

Tuple Fields of BadThms

0: Range<usize>
BadProofs(Range<usize>)

The portion of the mmb file that’s supposed to contain proofs was malformed.

Tuple Fields of BadProofs

0: Range<usize>
BadIndexParse

There was an issue parsing the index

Fields of BadIndexParse

p_index: usize

The (ostensible) location of the index in the file

DuplicateIndexTable

An index table ID was used more than once, for an ID that does not accept duplicates

Fields of DuplicateIndexTable

p_index: usize

The location of the index in the file

id: [u8; 4]

The duplicate ID

BadIndexLookup

An index lookup failed

Fields of BadIndexLookup

p_index: Option<usize>

The (ostensible) location of the index in the file, or None if there is no index

SorryError

A ‘sorry’ was detected and the function has no support for it

StrError(&'static strusize)

An error with the provided message and location.

Tuple Fields of StrError

0: &'static str1: usize
IoError(Error)

An error in IO.

Tuple Fields of IoError

0: Error

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.