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?

Re-exports

pub use self::SyntaxExtension::*;
use ast;
use ast::Attribute;
use ast::Name;
use ast::PatKind;
use ast::MetaItem;
use attr::HasAttrs;
use codemap;
use codemap::CodeMap;
use codemap::Spanned;
use codemap::respan;
use syntax_pos::Span;
use syntax_pos::MultiSpan;
use syntax_pos::DUMMY_SP;
use errors::DiagnosticBuilder;
use errors::DiagnosticId;
use ext::expand;
use ext::expand::Expansion;
use ext::expand::Invocation;
use ext::hygiene::Mark;
use ext::hygiene::SyntaxContext;
use fold;
use fold::Folder;
use parse;
use parse::parser;
use parse::DirectoryOwnership;
use parse::token;
use ptr::P;
use symbol::keywords;
use symbol::Ident;
use symbol::Symbol;
use util::small_vector::SmallVector;
use std::collections::HashMap;
use std::iter;
use std::path::PathBuf;
use std::rc::Rc;
use rustc_data_structures::sync;
use rustc_data_structures::sync::Lrc;
use std::default::Default;
use tokenstream;
use tokenstream::TokenStream;

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
]

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

Type Definitions

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