tamer: xir::{tree::=>}parse: Move module
It's a bit odd that I've done next to nothing with TAMER for the past week or so, and decided to do this one small thing before I go on break for the holidays, but I felt compelled to do _something_. Besides, this gets me in a better spot for the inevitable mental planning and writing I'll be doing over the holidays. This move was natural, given what this has evolved into---it has nothing to do with the concept of a "tree", and the modules imports emphasized that fact given the level of inappropriate nesting.main
parent
8221e3a011
commit
5af698d15c
|
@ -21,7 +21,7 @@
|
|||
|
||||
use crate::sym::SymbolId;
|
||||
use crate::tpwrap::quick_xml::{Error as XmlError, InnerXmlError};
|
||||
use crate::xir::tree::{parse::ParseError, StackError};
|
||||
use crate::xir::{parse::ParseError, tree::StackError};
|
||||
use std::fmt::Display;
|
||||
|
||||
/// Error during `xmlo` processing.
|
||||
|
|
|
@ -70,6 +70,7 @@ mod escape;
|
|||
pub use escape::{DefaultEscaper, Escaper};
|
||||
|
||||
pub mod iter;
|
||||
pub mod parse;
|
||||
pub mod pred;
|
||||
pub mod reader;
|
||||
pub mod tree;
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Basic streaming parsing framework to lower XIR into XIRT.
|
||||
//! Basic streaming parsing framework for XIR lowering operations.
|
||||
|
||||
use super::super::{Token, TokenStream};
|
||||
use super::{Token, TokenStream};
|
||||
use crate::span::Span;
|
||||
use std::fmt::Debug;
|
||||
use std::{error::Error, fmt::Display};
|
|
@ -85,8 +85,8 @@
|
|||
//! See also [`attr_parser_from`] for parsing only attributes partway
|
||||
//! through a token stream.
|
||||
//!
|
||||
//! [`Parsed::Incomplete`]: parse::Parsed::Incomplete
|
||||
//! [`Parsed::Object`]: parse::Parsed::Object
|
||||
//! [`Parsed::Incomplete`]: super::parse::Parsed::Incomplete
|
||||
//! [`Parsed::Object`]: super::parse::Parsed::Object
|
||||
//!
|
||||
//! Cost of Parsing
|
||||
//! ===============
|
||||
|
@ -174,14 +174,13 @@
|
|||
//! [state machine]: https://en.wikipedia.org/wiki/Finite-state_machine
|
||||
|
||||
mod attr;
|
||||
pub mod parse;
|
||||
|
||||
use self::{
|
||||
attr::{AttrParseError, AttrParseState},
|
||||
parse::{
|
||||
super::parse::{
|
||||
ParseError, ParseResult, ParseState, ParseStateResult, ParseStatus,
|
||||
ParsedResult,
|
||||
},
|
||||
attr::{AttrParseError, AttrParseState},
|
||||
};
|
||||
|
||||
use super::{QName, Token, TokenResultStream, TokenStream};
|
||||
|
@ -190,7 +189,7 @@ use std::{error::Error, fmt::Display, mem::take, result};
|
|||
|
||||
pub use attr::{Attr, AttrList};
|
||||
|
||||
type Parsed = parse::Parsed<Tree>;
|
||||
type Parsed = super::parse::Parsed<Tree>;
|
||||
|
||||
/// A XIR tree (XIRT).
|
||||
///
|
||||
|
@ -772,7 +771,7 @@ pub fn parser_from(
|
|||
pub fn attr_parser_from<'a>(
|
||||
toks: impl TokenStream,
|
||||
) -> impl Iterator<Item = result::Result<Attr, ParseError<StackError>>> {
|
||||
use parse::Parsed;
|
||||
use super::parse::Parsed;
|
||||
|
||||
AttrParseState::parse(toks).filter_map(|parsed| match parsed {
|
||||
Ok(Parsed::Object(attr)) => Some(Ok(attr)),
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
use crate::{
|
||||
span::Span,
|
||||
xir::{
|
||||
tree::parse::{ParseState, ParseStateResult, ParseStatus},
|
||||
parse::{ParseState, ParseStateResult, ParseStatus},
|
||||
QName, Token,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use super::super::parse::ParseError;
|
||||
use super::*;
|
||||
use crate::convert::ExpectInto;
|
||||
use crate::sym::GlobalSymbolIntern;
|
||||
use crate::xir::tree::parse::ParseError;
|
||||
|
||||
lazy_static! {
|
||||
static ref S: Span =
|
||||
|
|
Loading…
Reference in New Issue