tamer: asg::graph::object::ident::ObjectIndex::<Ident>: No edge reassignment yet

I'm spending a lot of time considering how the future system will work,
which is complicating the needs of the system now, which is to re-output the
source XML so that we can selectively start to replace things.

So I'm going to punt on this.

I was also planning out how that edge reassignment out to work, along with
traits to try to enforce it, and that is also complicated, so I may wind up
wanting to leave them in the end, or handling this
differently.  Specifically, I'll want to know how `value-of` expressions are
going to work on the graph first, since its target is going to be dynamic
and therefore not knowable at compile-time.  (Rather, I know how I want to
make them work, but I want to observe that working in practice first.)

DEV-13597
main
Mike Gerwitz 2023-01-19 15:55:27 -05:00
parent f1445961ee
commit ae675a8f29
1 changed files with 4 additions and 6 deletions

View File

@ -71,11 +71,6 @@ pub type TransitionResult<T> = Result<T, (T, TransitionError)>;
/// and since an [`Ident`] cannot transition away from
/// [`Transparent`],
/// this invariant is upheld.
/// 3. There must be _zero_ incoming edges to [`Transparent`].
/// When an identifier transitions to [`Transparent`],
/// incoming edges must be rewritten to the object to which the
/// identifier has become bound.
/// This is handled by [`ObjectIndex::<Ident>::bind_definition`].
#[derive(Debug, PartialEq, Clone)]
pub enum Ident {
/// An identifier is expected to be declared or defined but is not yet
@ -992,7 +987,10 @@ impl ObjectIndex<Ident> {
{
let my_span = self.into();
// TODO: Move all incoming edges to `definition`
// TODO: Should we move all incoming edges to `definition`?
// This will complicate re-outputting source XML,
// but may simplify other aspects of the system.
// Perhaps wait until this is needed.
self.try_map_obj(asg, |ident| match ident {
Transparent(id) => {
Err((ident, AsgError::IdentRedefine(id, my_span)))