18 releases (9 breaking)

0.10.0 Dec 23, 2023
0.8.1 Dec 20, 2023
0.7.0 Oct 2, 2023

#87 in Parser tooling

Download history 13/week @ 2024-02-18 15/week @ 2024-02-25 112/week @ 2024-03-31

112 downloads per month

MIT/Apache

165KB
4K SLoC

flexi-parse

flexi-parse is a parsing library intended to be more flexible than parser generators and parser combinators, while still being simple to use.

Features

  • Flexible. The parsing machinery supports many diverse grammars, with support for semantic whitespace, single- and double-quoted strings, custom delimiters, and more.
  • Simplicity. Built-in types for common symbols and helper macros for punctuation and keywords mean very little hacking is required to parse complex grammars.
  • Robustness. Powerful error recovery functionality in both the scanner and the parser allows for reporting every syntax error in a file with pinpoint accuracy.
  • Familiarity. The API is very similar to that of syn, making transfer from syn very simple.

Examples

Examples of this library in use can be found under the examples directory. calc.rs is a very simple command line calculator in under 100 lines of code, and lox is an implementation of the Lox language from Crafting Interpreters with full compile-time error recovery.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.6–1MB
~23K SLoC