Allow empty keywords.
This commit is contained in:
@@ -5,6 +5,7 @@ use nom::character::complete::line_ending;
|
||||
use nom::character::complete::space0;
|
||||
use nom::character::complete::space1;
|
||||
use nom::combinator::eof;
|
||||
use nom::combinator::opt;
|
||||
use nom::combinator::recognize;
|
||||
use nom::sequence::tuple;
|
||||
|
||||
@@ -22,8 +23,7 @@ pub fn keyword<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str,
|
||||
tag("#+"),
|
||||
is_not(" \t\r\n:"),
|
||||
tag(":"),
|
||||
space1,
|
||||
is_not("\r\n"),
|
||||
alt((recognize(tuple((space1, is_not("\r\n")))), space0)),
|
||||
alt((line_ending, eof)),
|
||||
)))(input)?;
|
||||
Ok((remaining, Keyword { source: rule }))
|
||||
|
||||
Reference in New Issue
Block a user