lip

Crates.iolip
lib.rslip
version8.1.2
sourcesrc
created_at2020-03-24 21:30:31.649134
updated_at2023-06-25 21:20:13.691895
descriptionLip provides powerful parser combinators for creating reusable and flexible parsers.
homepage
repositoryhttps://github.com/AlienKevin/lip
max_upload_size
id222451
size2,122,253
Xiang (Kevin) Li (AlienKevin)

documentation

README

lip logo

Lip

Lip provides powerful parser combinators for creating reusable and flexible parsers.

Why Lip?

  • Easy to understand - uses intuitive combinators like keep and skip
  • Compact - takes less than an hour to learn this library fully
  • Flexible and composable parser combinators
  • Efficient - minimal backtracking
  • Built-in support for precise, located error messages
  • Keep track of extra states like line number and instruction index
  • Extensible - create your own combinators if needed
// Parse an (x, y) position pair
use lip::*;
let position = succeed!(|x, y| (x, y))
  .keep(int())
  .skip(token(","))
  .keep(int())
  .run("2,3", ()); // run this parser on string "2,3" without extra states
// when parsing finished, position == (2, 3)

Tutorial

Reading the parser combinator by Bodil is an excellent way to know how parser combinators work.

License

MIT

Credits

Based on Bodil's Parser Combinator Tutorial and Evan's elm/paser.

Commit count: 111

cargo fmt