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},
ObjectKind,
},
diagnose::Annotate,
f::Functor,
parse::prelude::*,
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -58,8 +58,13 @@ pub mod prelude {
TransitionResult, Transitionable,
};
// Every `Token` must implement `Display`.
pub use std::fmt::Display;
// Every `Token`.
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`].

View File

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

View File

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