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.


  • 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.




  • 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.


  • 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, using T’s default parsing implementation, and continuing until input 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.
  • Gets the Ok value, panicking with a formatted error message if the value is Err.

Type Aliases

  • The input type for all parsing functions.
  • The return type of a parsing function.