pub fn until<V>(p: Parser<V>) -> Parser<String>
Expand description

Apply the parser until the other parser succeeds.

use memoir::*;

let p = until(symbol('!'));
let (out, rest) = p.parse("Hello World!").unwrap();

assert_eq!(out, String::from("Hello World"),);
assert_eq!(rest, "!");

assert!(p.parse("!").is_ok());
assert!(p.parse("Hello World").is_err());