Mike Gerwitz

Activist for User Freedom

path: root/tamer
diff options
authorMike Gerwitz <mike.gerwitz@ryansg.com>2021-12-23 13:17:18 -0500
committerMike Gerwitz <mike.gerwitz@ryansg.com>2021-12-23 13:17:18 -0500
commit5af698d15c0426b5c7c8c756afdca72ddcbce4b7 (patch)
treed1bb9b0a5ec5999dc02170befe7b380d4403f7c7 /tamer
parent8221e3a0115db7f32deb73b5f817cb02853ead0b (diff)
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.
Diffstat (limited to 'tamer')
-rw-r--r--tamer/src/xir/parse.rs (renamed from tamer/src/xir/tree/parse.rs)4
6 files changed, 12 insertions, 12 deletions
diff --git a/tamer/src/obj/xmlo/error.rs b/tamer/src/obj/xmlo/error.rs
index 8052479..d2655ad 100644
--- a/tamer/src/obj/xmlo/error.rs
+++ b/tamer/src/obj/xmlo/error.rs
@@ -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.
diff --git a/tamer/src/xir.rs b/tamer/src/xir.rs
index b65bf12..249796e 100644
--- a/tamer/src/xir.rs
+++ b/tamer/src/xir.rs
@@ -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;
diff --git a/tamer/src/xir/tree/parse.rs b/tamer/src/xir/parse.rs
index e96cdda..c819f90 100644
--- a/tamer/src/xir/tree/parse.rs
+++ b/tamer/src/xir/parse.rs
@@ -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};
diff --git a/tamer/src/xir/tree.rs b/tamer/src/xir/tree.rs
index 396aa84..bc850ed 100644
--- a/tamer/src/xir/tree.rs
+++ b/tamer/src/xir/tree.rs
@@ -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,
+ 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)),
diff --git a/tamer/src/xir/tree/attr/parse.rs b/tamer/src/xir/tree/attr/parse.rs
index dca7e60..a5c3018 100644
--- a/tamer/src/xir/tree/attr/parse.rs
+++ b/tamer/src/xir/tree/attr/parse.rs
@@ -22,7 +22,7 @@
use crate::{
- tree::parse::{ParseState, ParseStateResult, ParseStatus},
+ parse::{ParseState, ParseStateResult, ParseStatus},
QName, Token,
diff --git a/tamer/src/xir/tree/test.rs b/tamer/src/xir/tree/test.rs
index 17d901a..ce4da34 100644
--- a/tamer/src/xir/tree/test.rs
+++ b/tamer/src/xir/tree/test.rs
@@ -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 =