Allow empty keywords.

This commit is contained in:
Tom Alexander
2023-04-21 22:44:13 -04:00
parent ec80e1a0e0
commit ee126d2673
2 changed files with 3 additions and 3 deletions

View File

@@ -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 }))