tamer: obj::xmlo::error: Remove XirfError
This does not deal directly with XIRF (that's composed into a pipeline outside of this parser). I'd like to clean up further...perhaps I should retire the wip-xmlo-xir-reader flag now, despite the minor performance regression (see previous recent commits for explanation). DEV-10935main
parent
f07c0e75be
commit
4c69efd175
|
@ -28,7 +28,6 @@ extern crate tamer;
|
|||
|
||||
use getopts::{Fail, Options};
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use tamer::ld::poc::{self, TameldError};
|
||||
|
||||
/// Types of commands
|
||||
|
|
|
@ -19,11 +19,9 @@
|
|||
|
||||
//! Errors while processing `xmlo` object files.
|
||||
|
||||
use crate::parse::ParseError;
|
||||
use crate::span::Span;
|
||||
use crate::sym::SymbolId;
|
||||
use crate::tpwrap::quick_xml::{Error as XmlError, InnerXmlError};
|
||||
use crate::xir::{tree::StackError, Token};
|
||||
use std::fmt::Display;
|
||||
|
||||
/// Error during `xmlo` processing.
|
||||
|
@ -39,8 +37,6 @@ use std::fmt::Display;
|
|||
pub enum XmloError {
|
||||
/// XML parsing error (legacy, quick-xml).
|
||||
XmlError(XmlError),
|
||||
/// XIR parsing error.
|
||||
XirtError(ParseError<Token, StackError>),
|
||||
/// The root node was not an `lv:package`.
|
||||
UnexpectedRoot,
|
||||
/// A `preproc:sym` node was found, but is missing `@name`.
|
||||
|
@ -74,17 +70,10 @@ impl From<InnerXmlError> for XmloError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<ParseError<Token, StackError>> for XmloError {
|
||||
fn from(e: ParseError<Token, StackError>) -> Self {
|
||||
Self::XirtError(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for XmloError {
|
||||
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::XmlError(e) => e.fmt(fmt),
|
||||
Self::XirtError(e) => e.fmt(fmt),
|
||||
Self::UnexpectedRoot => {
|
||||
write!(fmt, "unexpected package root (is this a package?)")
|
||||
}
|
||||
|
@ -145,7 +134,6 @@ impl std::error::Error for XmloError {
|
|||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
match self {
|
||||
Self::XmlError(e) => Some(e),
|
||||
Self::XirtError(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue