tamer: parse::prelude: Include Display, Debug, and Error-related exports

Cut down on the import boilerplate some more for `ParseState`s.

DEV-13163
main
Mike Gerwitz 2023-06-28 11:34:33 -04:00
parent 8685527feb
commit 8449a2b759
10 changed files with 13 additions and 26 deletions

View File

@ -34,7 +34,6 @@ use crate::{
graph::object::{ObjectIndexRelTo, ObjectIndexTo}, graph::object::{ObjectIndexRelTo, ObjectIndexTo},
ObjectKind, ObjectKind,
}, },
diagnose::Annotate,
f::Functor, f::Functor,
parse::prelude::*, parse::prelude::*,
}; };

View File

@ -26,10 +26,7 @@ use super::{
ir::AirBindableMeta, ir::AirBindableMeta,
AirAggregate, AirAggregateCtx, AirAggregate, AirAggregateCtx,
}; };
use crate::{ use crate::{asg::graph::object::Meta, diagnostic_todo, parse::prelude::*};
asg::graph::object::Meta, diagnose::Annotate, diagnostic_todo,
parse::prelude::*,
};
/// Metasyntactic variable (metavariable) parser. /// Metasyntactic variable (metavariable) parser.
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]

View File

@ -26,7 +26,6 @@
use super::{super::AsgError, ir::AirIdent, AirAggregate, AirAggregateCtx}; use super::{super::AsgError, ir::AirIdent, AirAggregate, AirAggregateCtx};
use crate::parse::prelude::*; use crate::parse::prelude::*;
use std::fmt::Display;
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
pub enum AirOpaqueAggregate { pub enum AirOpaqueAggregate {

View File

@ -26,7 +26,7 @@ use super::{
ir::AirLiteratePkg, ir::AirLiteratePkg,
AirAggregate, AirAggregateCtx, AirAggregate, AirAggregateCtx,
}; };
use crate::{diagnose::Annotate, diagnostic_todo, parse::prelude::*}; use crate::{diagnostic_todo, parse::prelude::*};
/// Package parsing with support for loaded identifiers. /// Package parsing with support for loaded identifiers.
/// ///

View File

@ -26,12 +26,7 @@ use super::{
ir::AirBindableTpl, ir::AirBindableTpl,
AirAggregate, AirAggregateCtx, AirAggregate, AirAggregateCtx,
}; };
use crate::{ use crate::{fmt::TtQuote, parse::prelude::*, span::Span};
diagnose::Annotate,
fmt::{DisplayWrapper, TtQuote},
parse::prelude::*,
span::Span,
};
/// Template parser and token aggregator. /// Template parser and token aggregator.
/// ///

View File

@ -22,15 +22,13 @@
use super::Nir; use super::Nir;
use crate::{ use crate::{
asg::{air::Air, ExprOp}, asg::{air::Air, ExprOp},
diagnose::{Annotate, Diagnostic}, fmt::TtQuote,
fmt::{DisplayWrapper, TtQuote},
nir::{Nir::*, NirEntity::*}, nir::{Nir::*, NirEntity::*},
parse::prelude::*, parse::prelude::*,
span::Span, span::Span,
sym::{st::raw::U_TRUE, SymbolId}, sym::{st::raw::U_TRUE, SymbolId},
}; };
use arrayvec::ArrayVec; use arrayvec::ArrayVec;
use std::{error::Error, fmt::Display};
/// Dynamic [`NirToAir`] parser configuration. /// Dynamic [`NirToAir`] parser configuration.
/// ///

View File

@ -80,7 +80,7 @@ use arrayvec::ArrayVec;
use super::{Nir, NirEntity}; use super::{Nir, NirEntity};
use crate::{ use crate::{
fmt::{DisplayWrapper, TtQuote}, fmt::TtQuote,
parse::prelude::*, parse::prelude::*,
span::Span, span::Span,
sym::{ sym::{

View File

@ -58,8 +58,13 @@ pub mod prelude {
TransitionResult, Transitionable, TransitionResult, Transitionable,
}; };
// Every `Token` must implement `Display`. // Every `Token`.
pub use std::fmt::Display; pub use crate::fmt::DisplayWrapper;
pub use std::fmt::{Debug, Display};
// Every `ParseState::Error`.
pub use crate::diagnose::{Annotate, AnnotatedSpan, Diagnostic};
pub use std::error::Error;
} }
/// A single datum from a streaming IR with an associated [`Span`]. /// A single datum from a streaming IR with an associated [`Span`].

View File

@ -106,7 +106,6 @@ use crate::{
span::{Span, UNKNOWN_SPAN}, span::{Span, UNKNOWN_SPAN},
xir::EleSpan, xir::EleSpan,
}; };
use std::fmt::Display;
use XirfAutoClose::*; use XirfAutoClose::*;

View File

@ -46,7 +46,6 @@ use super::{
CloseSpan, OpenSpan, QName, Token as XirToken, TokenStream, CloseSpan, OpenSpan, QName, Token as XirToken, TokenStream,
}; };
use crate::{ use crate::{
diagnose::{Annotate, AnnotatedSpan, Diagnostic},
f::Functor, f::Functor,
parse::prelude::*, parse::prelude::*,
span::Span, span::Span,
@ -54,11 +53,7 @@ use crate::{
xir::EleSpan, xir::EleSpan,
}; };
use arrayvec::ArrayVec; use arrayvec::ArrayVec;
use std::{ use std::marker::PhantomData;
error::Error,
fmt::{Debug, Display},
marker::PhantomData,
};
// Used for organization. // Used for organization.
pub use accept::*; pub use accept::*;