Expand description
Fortification against sin. A new kind of parser for procedural macros.
Opposing syn
,
this crate is designed around the philosophy that malformed input
should be handled gracefully by procedural macros.
See the methods on the Parser
type for structural documentation.
§Stable Features
-
attributes
(enabled by default) — Provides support and utilities for parsing and handling Rust attributes. -
warnings
— Enables emitting diagnostic warnings through thevermouth::Diagnostic
API. -
complete
— Enables the complete suite of parsing utilities. This implies every other stable feature exceptproc-macro2
. -
proc-macro2
— Rewires this crate to build on top of theproc-macro2
crate, instead of the default, officially supportedproc_macro
crate. This feature should be enabled with caution, and it is considered a major breaking change to do so. Due to the risks of compounding additive features across dependencies, it can be problematic to enable this feature in a library, since it may break other dependencies of this crate.
§Unstable Features (nightly)
unstable-diagnostics-backend
— Enables theproc_macro
crate’s experimentalproc_macro_diagnostic
feature for higher quality diagnostics.
Modules§
- attributes
attributes
- Provides utilities for parsing attributes.
- path
- punctuated
Macros§
- for_
all_ punct_ seqs - Expands a macro with every distinct (supported) sequence of punctuation.
- punct_
decompose - Decomposes a larger token into a sequence of
char
s. - punct_
pat - Transforms a sequence of punctuation (like
&&
or..=
) into aPunctPat
.
Structs§
- Checkpoint
- A location in the stream of a
Parser
. - Diagnostic
- The universal type used for parsing diagnostics.
- Expected
- Builds an diagnostic which represents some syntax which was expected.
- Parser
- A simple parser for Rust source which traverses
TokenTree
s. - Parser
Pos - A reference to a position within the internal stream of a
Parser
. - Punct
Pat - A pattern representing a sequence of
Punct
s. - Spanned
- A simple wrapper which provides span information for any value.
Enums§
- Diagnostic
Level - The severity level of a custom
Diagnostic
. - Finish
- Describes the termination behaviour of
Parser::collect_until
.
Traits§
- Parse
- A common interface for parsing values from a
Parser
. - Pattern
- Performs simple pattern-matched parsing through a
Parser
object. - ToSpan
- Enables conversion between different span formats.
- ToTokens
- Methods for converting values into
TokenStream
s. - Token
Tree Ext - A trait extending the behaviour of
TokenTree
s. - Tokens
Extend - An extension trait for manually building
TokenStream
s more ergonomically.