Skip to main content

ProcMacro

Trait ProcMacro 

Source
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§

Source

type Error: Error

The error reported when expansion cannot produce a cell stream.

Required Methods§

Source

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".

Implementors§