Lifetime issue.

This commit is contained in:
Tom Alexander
2023-08-22 22:57:44 -04:00
parent cda49c628c
commit 6d1675fa00
2 changed files with 100 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ use nom::multi::many0;
use nom::multi::many_till;
use nom::sequence::tuple;
use super::org_source::OrgSource;
use super::parser_context::ContextElement;
use super::Context;
use crate::error::CustomError;
@@ -113,6 +114,15 @@ pub fn blank_line(input: &str) -> Res<&str, &str> {
recognize(tuple((space0, alt((line_ending, eof)))))(input)
}
/// A line containing only whitespace and then a line break
///
/// It is up to the caller to ensure this is called at the start of a line.
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn new_blank_line<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
not(eof)(input)?;
recognize(tuple((space0, alt((line_ending, eof)))))(input)
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn element_trailing_whitespace<'r, 's>(
context: Context<'r, 's>,