Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: aztec-macros refactor (AztecProtocol/aztec-packages#5127)
Partially addresses AztecProtocol/aztec-packages#5080 Until we have full macro support in noir, this PR aims to make using what we currently have a little bit less painful. The crate is now divided into utils of several kind (ast manipulation, error handling, hir manipulation...) and transforms. A transform is an end-to-end modification to the noir code that generates a valid compilation result from a given contract. This makes it easier to manipulate (and hopefully soon, replace) said modifications atomically, improving readability. This also modifies the first macro pass to iterate over all crates, not only the root one, which allows us to implement more stuff without having to dig deep into the def collector or (god forbid) the interner. The second macro pass has been renamed to `process_collected_defs`. Tried to generalize it a bit more, but providing a mutable ref for the whole `def_collector` turned out to be tricky without cloning `def_maps`, so it's staying like it is now.
- Loading branch information