Module syntax::ext::base [] [src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Reexports

pub use self::SyntaxExtension::*;

Structs

DummyResolver [
Experimental
]
DummyResult [
Experimental
]

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

ExpansionData [
Experimental
]
ExtCtxt [
Experimental
]

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_info of their expansion context stored into their span.

MacEager [
Experimental
]

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

ModuleData [
Experimental
]

Enums

Annotatable [
Experimental
]
Determinacy [
Experimental
]
MacroKind [
Experimental
]

Represents different kinds of macro invocations that can be resolved.

SyntaxExtension [
Experimental
]

An enum representing the different kinds of syntax extensions.

Traits

AttrProcMacro [
Experimental
]
IdentMacroExpander [
Experimental
]
MacResult [
Experimental
]

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

MultiItemDecorator [
Experimental
]
MultiItemModifier [
Experimental
]
ProcMacro [
Experimental
]
Resolver [
Experimental
]
TTMacroExpander [
Experimental
]

Represents a thing that maps token trees to Macro Results

Functions

check_zero_tts [
Experimental
]

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 [
Experimental
]

Extract 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 [
Experimental
]
get_exprs_from_tts [
Experimental
]

Extract comma-separated expressions from tts. If there is a parsing error, emit a non-fatal error and return None.

get_single_str_from_tts [
Experimental
]

Extract the string literal from the first token of tts. If this is not a string literal, emit an error and return None.

Type Definitions

BuiltinDeriveFn [
Experimental
]
IdentMacroExpanderFn [
Experimental
]
MacroExpanderFn [
Experimental
]
NamedSyntaxExtension [
Experimental
]