Crate flexi_parse
source ·Expand description
flexi-parse is a crate for parsing arbitrary syntax into a syntax tree. It is intended to be more flexible than a parser generator or parser combinator, while still being simple to use.
Modules
- Types for error reporting.
- Streams of tokens delimited by punctuation.
- Utilities for parsing types separated by punctuation.
- A trait for converting types composed of tokens into a
TokenStream
. - Tokens representing punctuation, identifiers, keywords, and whitespace.
Macros
- A macro to get the type of a punctuation token.
- A macro to easily parse a delimited group.
- Generate types for keywords.
- Returns true if
ParseBuffer::peek2
would return true for any types passed. - Returns true if
ParseBuffer::peek
would return true for any types passed.
Structs
- A type for peeking at the next token, and generating a helpful error if it isn’t an expected type.
- A cursor position within a token stream.
- A struct representing a file of source code.
- A region of source code.
- ToTokensWrapper
proc-macro2
A wrapper for types that implementcrate::to_tokens::ToTokens
which implementsquote::ToTokens
. - A sequence of tokens.
Traits
- Parsing interface for types with a default parsing method.
- A parser that can parse a stream of tokens into a syntax tree node.
- Types that can be parsed by looking at a single token.
Functions
- Creates a new error in the given source file, at the given location, and with the given message and code.
- Parses the given tokens into the syntax tree node
T
. - Attempts to repeatedly parse
input
into the given syntax tree node, usingT
’s default parsing implementation, and continuing untilinput
is exhausted. - Scans and parses the given source file into the syntax tree node
T
. - Scans and parses the given string into the syntax tree node
T
. - pretty_unwrap
ariadne
Gets theOk
value, panicking with a formatted error message if the value isErr
.
Type Aliases
- The input type for all parsing functions.
- The return type of a parsing function.