Simple helper to register macro handler and process their input from build.rs Currently supports only function-like macro.
Useful when your macro should output a file, but you want to avoid race conditions during incremental compilation and other routines.
Uses syn
to parse files and visit their macros.
Imagine you have some macro css
that implements scoping css technic.
It processes CSS syntax and returns css_class. But you also need to aggregate all css
!calls and save them into
style.css`
In order to aggregate all CSS, you should open all src files, find if `css!`` was used and handle their input. You also should handle imports and renames.
The target of this crate is to deal with these problems.
In build.rs
macro-visit
will find all occurrences of css!
macro, even if it was renamed.
Currently, it only looks for imports inside one file at a time and does not parallelize file processing.