Support todo keywords with fast access.
This commit is contained in:
parent
830097b0a9
commit
32b19d68d0
@ -44,9 +44,17 @@ pub(crate) fn todo_keywords<'s>(input: &'s str) -> Res<&'s str, (Vec<&'s str>, V
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn todo_keyword_word<'s>(input: &'s str) -> Res<&'s str, &'s str> {
|
fn todo_keyword_word<'s>(input: &'s str) -> Res<&'s str, &'s str> {
|
||||||
verify(take_till(|c| " \t\r\n|".contains(c)), |result: &str| {
|
let (remaining, keyword) = verify(take_till(|c| "( \t\r\n|".contains(c)), |result: &str| {
|
||||||
!result.is_empty()
|
!result.is_empty()
|
||||||
})(input)
|
})(input)?;
|
||||||
|
|
||||||
|
let (remaining, _) = opt(tuple((
|
||||||
|
tag("("),
|
||||||
|
take_till(|c| "() \t\r\n|".contains(c)),
|
||||||
|
tag(")"),
|
||||||
|
)))(remaining)?;
|
||||||
|
|
||||||
|
Ok((remaining, keyword))
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user