Convert all functions to using the wrapped input type.
This commit is contained in:
@@ -7,6 +7,7 @@ use nom::multi::many_till;
|
||||
use nom::sequence::tuple;
|
||||
|
||||
use super::lesser_element::Paragraph;
|
||||
use super::org_source::OrgSource;
|
||||
use super::util::blank_line;
|
||||
use super::util::get_consumed;
|
||||
use super::Context;
|
||||
@@ -21,7 +22,10 @@ use crate::parser::util::exit_matcher_parser;
|
||||
use crate::parser::util::start_of_line;
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
pub fn paragraph<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Paragraph<'s>> {
|
||||
pub fn paragraph<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, Paragraph<'s>> {
|
||||
let parser_context =
|
||||
context.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
class: ExitClass::Beta,
|
||||
@@ -39,11 +43,20 @@ pub fn paragraph<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s st
|
||||
|
||||
let source = get_consumed(input, remaining);
|
||||
|
||||
Ok((remaining, Paragraph { source, children }))
|
||||
Ok((
|
||||
remaining,
|
||||
Paragraph {
|
||||
source: source.into(),
|
||||
children,
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
fn paragraph_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
||||
fn paragraph_end<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
let non_paragraph_element_matcher = parser_with_context!(element(false))(context);
|
||||
let start_of_line_matcher = parser_with_context!(start_of_line)(&context);
|
||||
alt((
|
||||
|
||||
Reference in New Issue
Block a user