pub fn elm_ref<'a, I>(element: I) -> Parser<'a, I, &'a I>
Expand description
Returns a Parser that parses the specified element.(for reference)
指定した要素を解析するParserを返します。(参照版)
- element: element
- element: 要素
§Example(例)
use oni_comb_parser_rs::prelude::*;
let text: &str = "x";
let input: Vec<char> = text.chars().collect::<Vec<_>>();
let parser: Parser<char, &char> = elm_ref('x');
let result: ParseResult<char, &char> = parser.parse(&input);
assert!(result.is_success());
assert_eq!(result.success().unwrap(), &input[0]);