[][src]Module rustc_ap_rustc_expand::base

Structs

DummyResult

Fill-in macro expansion result, to allow compilation to continue after hitting errors.

ExpansionData
ExtCtxt

One of these is made during expansion and incrementally updated as we go; when a macro expansion occurs, the resulting nodes have the backtrace() -> expn_data of their expansion context stored into their span.

Indeterminate

Error type that denotes indeterminacy.

MacEager

MacResult implementation for the common case where you've already built each form of AST that you might return.

ModuleData
SyntaxExtension

A struct representing a macro definition in "lowered" form ready for expansion.

Enums

Annotatable
ExpandResult

Result of an expansion that may need to be retried. Consider using this for non-MultiItemModifier expanders as well.

InvocationRes

Result of resolving a macro invocation.

SyntaxExtensionKind

A syntax extension kind.

Traits

AttrProcMacro
MacResult

The result of a macro expansion. The return values of the various methods are spliced into the AST at the callsite of the macro.

MultiItemModifier
ProcMacro
Resolver
TTMacroExpander

Represents a thing that maps token trees to Macro Results

Functions

check_zero_tts

Non-fatally assert that tts is empty. Note that this function returns even when tts is non-empty, macros that need to stop compilation should call cx.parse_sess.span_diagnostic.abort_if_errors() (this should be done as rarely as possible).

expr_to_spanned_string

Extracts a string literal from the macro expanded version of expr, emitting err_msg if expr is not a string literal. This does not stop compilation on error, merely emits a non-fatal error and returns None.

expr_to_string
get_exprs_from_tts

Extracts comma-separated expressions from tts. On error, emit it, and return None.

get_single_str_from_tts

Interpreting tts as a comma-separated sequence of expressions, expect exactly one string literal, or emit an error and return None.

parse_expr

Parse an expression. On error, emit it, advancing to Eof, and return None.

Type Definitions

MacroExpanderFn