Crate proc_macro1.15.0[−][src]
A support library for macro authors when defining new macros.
This library, provided by the standard distribution, provides the types
consumed in the interfaces of procedurally defined macro definitions.
Currently the primary use of this crate is to provide the ability to define
new custom derive modes through #[proc_macro_derive]
.
Note that this crate is intentionally very bare-bones currently. The main
type, TokenStream
, only supports fmt::Display
and FromStr
implementations, indicating that it can only go to and come from a string.
This functionality is intended to be expanded over time as more surface
area for macro authors is stabilized.
See the book for more.
Re-exports
extern crate std; |
extern crate syntax; |
extern crate syntax_pos; |
extern crate rustc_errors; |
extern crate rustc_data_structures; |
use std::prelude::v1::*; |
use std::ascii; |
use std::fmt; |
use std::iter; |
use rustc_data_structures::sync::Lrc; |
use std::str::FromStr; |
use syntax::ast; |
use syntax::errors::DiagnosticBuilder; |
use syntax::parse; |
use syntax::parse::token; |
use syntax::symbol::Symbol; |
use syntax::tokenstream; |
use syntax::parse::lexer::comments; |
use syntax_pos::FileMap; |
use syntax_pos::Pos; |
use syntax_pos::SyntaxContext; |
use syntax_pos::FileName; |
use syntax_pos::hygiene::Mark; |
Modules
__internal |
[ Experimental ] Permanently unstable internal implementation details of this crate. This should not be used. |
diagnostic | |
quote |
[ Experimental ] Quasiquoter |
token_stream |
[ Experimental ] Implementation details for the |
Macros
quote |
[ Experimental ]
|
Structs
LexError |
Error returned from |
TokenStream |
The main type provided by this crate, representing an abstract stream of tokens. |
Diagnostic |
[ Experimental ] A structure representing a diagnostic message and associated children messages. |
Group |
[ Experimental ] A delimited token stream |
LineColumn |
[ Experimental ] A line-column pair representing the start or end of a |
Literal |
[ Experimental ] A literal character ( |
Op |
[ Experimental ] An |
SourceFile |
[ Experimental ] The source file of a given |
Span |
[ Experimental ] A region of source code, along with macro expansion information. |
Term |
[ Experimental ] An interned string. |
Enums
Delimiter |
[ Experimental ] Describes how a sequence of token trees is delimited. |
Level |
[ Experimental ] An enum representing a diagnostic level. |
Spacing |
[ Experimental ] Whether an |
TokenTree |
[ Experimental ] A single token or a delimited sequence of token trees (e.g. |
Functions
parse_to_lex_err | |
quote_span |
[ Experimental ] Quote a |