Module syn
A Rust parser used by procedural macros.
See crate ::syn.
Modules
- buffer A stably addressed token buffer supporting efficient traversal based on a cheaply copyable cursor.
- ext Extension traits to provide parsing methods on foreign types.
-
meta
Facility for interpreting structured content inside of an
Attribute. - parse Parsing interface for parsing a token stream into a syntax tree node.
- punctuated A punctuated sequence of syntax tree nodes separated by punctuation.
-
spanned
A trait that can provide the
Spanof the complete contents of a syntax tree node. - token Tokens representing Rust punctuation, keywords, and delimiters.
Functions
- parse Parse tokens of source code into the chosen syntax tree node.
- parse2 Parse a proc-macro2 token stream into the chosen syntax tree node.
- parse_file Parse the content of a file of Rust code.
- parse_str Parse a string of Rust code into the chosen syntax tree node.
Macros
- Token A type-macro that expands to the name of the Rust type representation of a given token.
- braced Parse a set of curly braces and expose their content to subsequent parsers.
- bracketed Parse a set of square brackets and expose their content to subsequent parsers.
- custom_keyword Define a type that supports parsing and printing a given identifier as if it were a keyword.
- custom_punctuation Define a type that supports parsing and printing a multi-character symbol as if it were a punctuation token.
- parenthesized Parse a set of parentheses and expose their content to subsequent parsers.
- parse_macro_input Parse the input TokenStream of a macro, triggering a compile error if the tokens fail to parse.
-
parse_quote
Quasi-quotation macro that accepts input like the
quote!macro but uses type inference to figure out a return type for those tokens. -
parse_quote_spanned
This macro is [
parse_quote!] + [quote_spanned!][quote::quote_spanned].