tamer: asg::graph::object::prelude: New module to reduce imports
These are used by virtually every `ObjectKind`; I've been meaning to do this for a while, but now that I'm about to introduce a new one (`Doc`), let's just get it out of the way. DEV-13708main
parent
f4653790da
commit
0163391498
|
@ -151,6 +151,16 @@ pub use rel::{
|
|||
pub use root::Root;
|
||||
pub use tpl::Tpl;
|
||||
|
||||
/// Often-needed exports for [`ObjectKind`]s.
|
||||
pub mod prelude {
|
||||
pub use super::{
|
||||
super::{super::error::AsgError, Asg},
|
||||
Object, ObjectIndex, ObjectIndexRelTo, ObjectKind, ObjectRel,
|
||||
ObjectRelFrom, ObjectRelTo, ObjectRelTy, ObjectRelatable,
|
||||
ObjectTreeRelTo,
|
||||
};
|
||||
}
|
||||
|
||||
/// Given a list of [`ObjectKind`]s,
|
||||
/// generate [`Object`],
|
||||
/// associated types,
|
||||
|
@ -313,8 +323,6 @@ object_gen! {
|
|||
Ident,
|
||||
|
||||
/// Expression.
|
||||
///
|
||||
/// An expression may optionally be named by one or more [`Ident`]s.
|
||||
Expr,
|
||||
|
||||
/// A template definition.
|
||||
|
|
|
@ -21,10 +21,7 @@
|
|||
|
||||
use std::fmt::Display;
|
||||
|
||||
use super::{
|
||||
Asg, Ident, Object, ObjectIndex, ObjectIndexRelTo, ObjectRel,
|
||||
ObjectRelFrom, ObjectRelTy, ObjectRelatable, ObjectTreeRelTo, Tpl,
|
||||
};
|
||||
use super::{prelude::*, Ident, Tpl};
|
||||
use crate::{
|
||||
f::Functor,
|
||||
num::Dim,
|
||||
|
|
|
@ -19,11 +19,7 @@
|
|||
|
||||
//! Identifiers (a type of [object](super)).
|
||||
|
||||
use super::{
|
||||
super::{Asg, AsgError, ObjectIndex, ObjectKind},
|
||||
Expr, Meta, Object, ObjectIndexRelTo, ObjectRel, ObjectRelFrom,
|
||||
ObjectRelTo, ObjectRelTy, ObjectRelatable, ObjectTreeRelTo, Pkg, Tpl,
|
||||
};
|
||||
use super::{prelude::*, Expr, Meta, Pkg, Tpl};
|
||||
use crate::{
|
||||
diagnose::{Annotate, Diagnostic},
|
||||
diagnostic_todo,
|
||||
|
|
|
@ -24,12 +24,8 @@
|
|||
//! have historically been a feature of the template system.
|
||||
//! The canonical metavariable is the template parameter.
|
||||
|
||||
use super::{
|
||||
Ident, Object, ObjectIndex, ObjectIndexRelTo, ObjectRel, ObjectRelFrom,
|
||||
ObjectRelTy, ObjectRelatable, ObjectTreeRelTo, Tpl,
|
||||
};
|
||||
use super::{prelude::*, Ident, Tpl};
|
||||
use crate::{
|
||||
asg::Asg,
|
||||
diagnose::Annotate,
|
||||
diagnostic_todo,
|
||||
f::Functor,
|
||||
|
|
|
@ -19,12 +19,8 @@
|
|||
|
||||
//! Package object on the ASG.
|
||||
|
||||
use super::{
|
||||
Ident, Object, ObjectIndex, ObjectIndexRelTo, ObjectRel, ObjectRelFrom,
|
||||
ObjectRelTy, ObjectRelatable, ObjectTreeRelTo, Tpl,
|
||||
};
|
||||
use super::{prelude::*, Ident, Tpl};
|
||||
use crate::{
|
||||
asg::Asg,
|
||||
f::Functor,
|
||||
parse::{util::SPair, Token},
|
||||
span::Span,
|
||||
|
|
|
@ -21,10 +21,7 @@
|
|||
|
||||
use std::fmt::Display;
|
||||
|
||||
use super::{
|
||||
Ident, Object, ObjectIndex, ObjectRel, ObjectRelFrom, ObjectRelTy,
|
||||
ObjectRelatable, ObjectTreeRelTo, Pkg,
|
||||
};
|
||||
use super::{prelude::*, Ident, Pkg};
|
||||
|
||||
#[cfg(doc)]
|
||||
use super::ObjectKind;
|
||||
|
|
|
@ -21,11 +21,8 @@
|
|||
|
||||
use std::fmt::Display;
|
||||
|
||||
use super::{
|
||||
Expr, Ident, Object, ObjectIndex, ObjectIndexRelTo, ObjectRel,
|
||||
ObjectRelFrom, ObjectRelTy, ObjectRelatable, ObjectTreeRelTo,
|
||||
};
|
||||
use crate::{asg::Asg, f::Functor, span::Span};
|
||||
use super::{prelude::*, Expr, Ident};
|
||||
use crate::{f::Functor, span::Span};
|
||||
|
||||
/// Template with associated name.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
|
|
Loading…
Reference in New Issue