1. I have a generator phase that imports external references making all of them internal to essentially statically link referenced modules in my language. The referenced modules are detected automatically by providing an interface that all concepts which might reference an external node implement and are then searched for.
2. I have a language extension that converts instances of a concept defined within it to a reference to a node defined in a module written in my language.
If I run 1 before I run 2 then the external reference generated in #2 isn't detected by #1. If I run 2 before I run 1 then any external references brought in that use the concept I mention in #2 don't get transformed and make it all the way through to the output where the textgen doesn't know what to do w/ them.
It seems like I need to alternate running them until all the dust settles. Is there a mechanism for doing this?
Another alternative I've considered is having the concept defined in #2 act as an external reference to the node it generates, but it'd need some way to then be told when it gets generated eventually it should use the copied version of this node instead of the proper one which seems like more work than should be necessary to me.