oni_comb_parser_rs::prelude

Function empty

Source
pub fn empty<'a, I>() -> Parser<'a, I, ()>
Expand description

Returns a Parser that does nothing. It is an alias for unit().
何もしないParserを返します。unit()のエイリアスです。

§Example

use oni_comb_parser_rs::prelude::*;

let text: &str = "a";
let input: Vec<char> = text.chars().collect::<Vec<_>>();

let parser: Parser<char, ()> = empty();

let result: ParseResult<char, ()> = parser.parse(&input);

assert!(result.is_success());
assert_eq!(result.success().unwrap(), ());