Going to switch to using immutable fn instead of FnMut so I can easily make a context tree.
This commit is contained in:
@@ -138,8 +138,9 @@ pub fn paragraph_end(input: &str) -> Res<&str, &str> {
|
||||
|
||||
pub fn document(input: &str) -> Res<&str, Vec<(Vec<TextElement>, &str)>> {
|
||||
let initial_context = TestContext::new();
|
||||
let paragraph_context =
|
||||
initial_context.with_additional_fail_matcher(Rc::new(RefCell::new(paragraph_end)));
|
||||
let paragraph_context = initial_context;
|
||||
// let paragraph_context =
|
||||
// initial_context.with_additional_fail_matcher(Rc::new(RefCell::new(paragraph_end)));
|
||||
// let initial_context = NomContext::new(Rc::new(RefCell::new(paragraph_end)));
|
||||
let ret = many1(parser_with_context!(paragraph)(¶graph_context))(input);
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user