This commit is contained in:
Tom Alexander
2023-04-22 01:45:38 -04:00
parent 92ee59558b
commit 9861084afe
8 changed files with 16 additions and 33 deletions

View File

@@ -161,10 +161,8 @@ pub fn plain_list_item<'r, 's>(
exit_matcher: &plain_list_item_end,
}));
let element_matcher = element(true);
let element_matcher = &element_matcher;
let with_consume_matcher = parser_with_context!(element_matcher)(&with_consume_context);
let without_consume_matcher = parser_with_context!(element_matcher)(&without_consume_context);
let with_consume_matcher = parser_with_context!(element(true))(&with_consume_context);
let without_consume_matcher = parser_with_context!(element(true))(&without_consume_context);
let exit_matcher = parser_with_context!(exit_matcher_parser)(&with_consume_context);
let (remaining, bull) =
verify(bullet, |bull: &str| bull != "*" || indent_level > 0)(remaining)?;
@@ -372,8 +370,7 @@ mod tests {
let initial_context: ContextTree<'_, '_> = ContextTree::new();
let document_context =
initial_context.with_additional_node(ContextElement::DocumentRoot(input));
let element_matcher = element(true);
let plain_list_matcher = parser_with_context!(element_matcher)(&document_context);
let plain_list_matcher = parser_with_context!(element(true))(&document_context);
let (remaining, result) =
plain_list_matcher(input).expect("Should parse the plain list successfully.");
assert_eq!(remaining, " ipsum\n");
@@ -399,8 +396,7 @@ baz"#;
let initial_context: ContextTree<'_, '_> = ContextTree::new();
let document_context =
initial_context.with_additional_node(ContextElement::DocumentRoot(input));
let element_matcher = element(true);
let plain_list_matcher = parser_with_context!(element_matcher)(&document_context);
let plain_list_matcher = parser_with_context!(element(true))(&document_context);
let (remaining, result) =
plain_list_matcher(input).expect("Should parse the plain list successfully.");
assert_eq!(remaining, "baz");
@@ -431,8 +427,7 @@ dolar"#;
let initial_context: ContextTree<'_, '_> = ContextTree::new();
let document_context =
initial_context.with_additional_node(ContextElement::DocumentRoot(input));
let element_matcher = element(true);
let plain_list_matcher = parser_with_context!(element_matcher)(&document_context);
let plain_list_matcher = parser_with_context!(element(true))(&document_context);
let (remaining, result) =
plain_list_matcher(input).expect("Should parse the plain list successfully.");
assert_eq!(remaining, "dolar");