Trait syntax::ext::base::MacResult[src]

pub trait MacResult {
    fn make_def(&self) -> Option<MacroDef> { ... }
    fn make_expr(&self) -> Option<Gc<Expr>> { ... }
    fn make_items(&self) -> Option<SmallVector<Gc<Item>>> { ... }
    fn make_pat(&self) -> Option<Gc<Pat>> { ... }
    fn make_stmt(&self) -> Option<Gc<Stmt>> { ... }
}

The result of a macro expansion. The return values of the various methods are spliced into the AST at the callsite of the macro (or just into the compiler's internal macro table, for make_def).

Provided Methods

fn make_def(&self) -> Option<MacroDef>

Define a new macro.

fn make_expr(&self) -> Option<Gc<Expr>>

Create an expression.

fn make_items(&self) -> Option<SmallVector<Gc<Item>>>

Create zero or more items.

fn make_pat(&self) -> Option<Gc<Pat>>

Create a pattern.

fn make_stmt(&self) -> Option<Gc<Stmt>>

Create a statement.

By default this attempts to create an expression statement, returning None if that fails.

Implementors