Module parser

Source
Expand description

A parser for regular expressions.

§Features

  • Provides a parse function that converts a regular expression string into a FinalNode struct which is the root of an abstract syntax tree
  • Implements a straightforward contex-free grammar parser
  • Parses in a single pass
  • No recursion, no risk of stack overflow
  • forbid(unsafe)
  • Depends only on std
  • Good test coverage (92%)

§Limitations

  • Parses only raw byte strings, br"...".
  • Allocates. Uses Vec and String.

§Alternatives

Enums§

ClassItem
An element of a regular expression character class.
FinalNode
A completely parsed element of a regular expression abstract syntax tree (AST).
Node
An AST node used during parsing.
NonFinalNode
AST nodes used internally during parsing.

Functions§

parse
Parses regex as a regular expression.