Module syntax::ext::base[src]

Structs

BasicIdentMacroExpander
BasicMacroExpander
BlockInfo
DummyResult

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

ExtCtxt
MacExpr

A convenience type for macros that return a single expression.

MacItem

A convenience type for macros that return a single item.

MacPat

A convenience type for macros that return a single pattern.

MacroDef
SyntaxEnv

Enums

SyntaxExtension

An enum representing the different kinds of syntax extensions.

Traits

IdentMacroExpander
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 (or just into the compiler's internal macro table, for make_def).

MacroExpander

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_str

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.

get_exprs_from_tts

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

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

syntax_expander_table

Type Definitions

IdentMacroExpanderFn
ItemDecorator
ItemModifier
MacroExpanderFn
NamedSyntaxExtension
RenameList