microparsec 0.1.0

A simple parser combinator crate for Rust.
Documentation
  • Coverage
  • 63.79%
    37 out of 58 items documented16 out of 16 items with examples
  • Size
  • Source code size: 54.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 9.52 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • ComicalCache/microparsec
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ComicalCache

microparsec

A simple parser crate for Rust.

How to use

Look at the documentation to see how to use each parser.

Example

use microparsec::{ParserRc, SpacesParser, StringParser, SequenceParser, StringParserT, ContextParserT, parsers};

let hello_parser = StringParser::new("Hello");
let spaces_parser = SpacesParser::new();
let world_parser = StringParser::new("World");
let res = SequenceParser::new(parsers!(hello_parser, spaces_parser, world_parser)).parse("Hello  World");

assert_eq!(
    res.unwrap().val,
    vec!["Hello".to_string(), "  ".to_string(), "World".to_string()]
);