pub trait ProcMacro<Args = ()> {
type Error: Error;
// Required method
fn expand(
&mut self,
input: CellStream,
args: &Args,
) -> Result<CellStream, Self::Error>;
}Expand description
A procedural macro over independently parseable Macaulay2 cells.
Implementations may parse the cells into the typed syntax graph, transform raw tokens directly, perform arbitrary Rust computations, or combine those approaches. The caller decides whether expansion happens for one submitted cell or for a complete source file.
Required Associated Types§
Required Methods§
Sourcefn expand(
&mut self,
input: CellStream,
args: &Args,
) -> Result<CellStream, Self::Error>
fn expand( &mut self, input: CellStream, args: &Args, ) -> Result<CellStream, Self::Error>
Expands input using the invocation arguments in args.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".