Implement a basic paragraph parser.
This commit is contained in:
@@ -155,7 +155,7 @@ fn headline<'r, 's>(
|
||||
}
|
||||
|
||||
fn headline_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
||||
line_ending(input)
|
||||
alt((line_ending, eof))(input)
|
||||
}
|
||||
|
||||
/// Check that we are at the start of a line
|
||||
@@ -199,7 +199,7 @@ fn is_slice_of(parent: &str, child: &str) -> bool {
|
||||
}
|
||||
|
||||
/// Get a slice of the string that was consumed in a parser using the original input to the parser and the remaining input after the parser.
|
||||
fn get_consumed<'s>(input: &'s str, remaining: &'s str) -> &'s str {
|
||||
pub fn get_consumed<'s>(input: &'s str, remaining: &'s str) -> &'s str {
|
||||
assert!(is_slice_of(input, remaining));
|
||||
let source = {
|
||||
let offset = remaining.as_ptr() as usize - input.as_ptr() as usize;
|
||||
|
||||
Reference in New Issue
Block a user