From cdfe9083f8a940989b5090eba4e0481951eccfa1 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 17 Jan 2023 22:48:19 -0500 Subject: [PATCH] tamer: asg: Move {expr,ident} into object/ Starting to re-organize things to match my mental model of the new system; the ASG abstraction has changed quite a bit since the early days. This isn't quite enough, though; see next commit. DEV-13597 --- tamer/src/asg/mod.rs | 14 +++++++------- tamer/src/asg/object.rs | 3 +++ tamer/src/asg/{ => object}/expr.rs | 0 tamer/src/asg/{ => object}/ident.rs | 5 ++++- tamer/src/asg/{ => object}/ident/test.rs | 0 5 files changed, 14 insertions(+), 8 deletions(-) rename tamer/src/asg/{ => object}/expr.rs (100%) rename tamer/src/asg/{ => object}/ident.rs (99%) rename tamer/src/asg/{ => object}/ident/test.rs (100%) diff --git a/tamer/src/asg/mod.rs b/tamer/src/asg/mod.rs index 87dba0f2..a2ae602e 100644 --- a/tamer/src/asg/mod.rs +++ b/tamer/src/asg/mod.rs @@ -64,21 +64,21 @@ //! if either identifier has not yet been declared. mod error; -mod expr; mod graph; -mod ident; mod object; pub mod air; pub use error::AsgError; -pub use expr::{Expr, ExprDim, ExprOp}; pub use graph::{Asg, AsgResult, IndexType}; -pub use ident::{ - FragmentText, Ident, IdentKind, Source, TransitionError, TransitionResult, - UnresolvedError, +pub use object::{ + expr::{Expr, ExprDim, ExprOp}, + ident::{ + FragmentText, Ident, IdentKind, Source, TransitionError, + TransitionResult, UnresolvedError, + }, + Object, ObjectIndex, ObjectKind, }; -pub use object::{Object, ObjectIndex, ObjectKind}; /// Default concrete ASG implementation. pub type DefaultAsg = graph::Asg; diff --git a/tamer/src/asg/object.rs b/tamer/src/asg/object.rs index fe691809..9f9b5d83 100644 --- a/tamer/src/asg/object.rs +++ b/tamer/src/asg/object.rs @@ -71,6 +71,9 @@ use crate::{ use petgraph::graph::NodeIndex; use std::{convert::Infallible, fmt::Display, marker::PhantomData}; +pub mod expr; +pub mod ident; + /// An object on the ASG. /// /// See the [module-level documentation](super) for more information. diff --git a/tamer/src/asg/expr.rs b/tamer/src/asg/object/expr.rs similarity index 100% rename from tamer/src/asg/expr.rs rename to tamer/src/asg/object/expr.rs diff --git a/tamer/src/asg/ident.rs b/tamer/src/asg/object/ident.rs similarity index 99% rename from tamer/src/asg/ident.rs rename to tamer/src/asg/object/ident.rs index 3157e4b1..eaebd89b 100644 --- a/tamer/src/asg/ident.rs +++ b/tamer/src/asg/object/ident.rs @@ -19,7 +19,10 @@ //! Identifiers (a type of [object][super::object]). -use super::{object::ObjectRelTo, Asg, AsgError, ObjectIndex, ObjectKind}; +use super::{ + super::{Asg, AsgError, ObjectIndex, ObjectKind}, + ObjectRelTo, +}; use crate::{ diagnose::{Annotate, Diagnostic}, f::Functor, diff --git a/tamer/src/asg/ident/test.rs b/tamer/src/asg/object/ident/test.rs similarity index 100% rename from tamer/src/asg/ident/test.rs rename to tamer/src/asg/object/ident/test.rs