Skip to content

Commit

Permalink
Make first_word check it's not followed by a continuation char. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Oct 28, 2018
1 parent 7f8337d commit 1e03122
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ pub(crate) fn assert_parse_eq<T: Debug + PartialEq>(
}

pub(crate) fn first_word(i: StrSpan) -> Result<(StrSpan, &str), ::nom::Err<StrSpan>> {
match ::nom::alpha(i) {
Ok((i, s)) => Ok((i, s.fragment.0)),
Err(e) => Err(e),
}
map!(i, terminated!(call!(::nom::alpha), word_end), |s| s.fragment.0)
}

// https://github.com/Geal/nom/pull/800
Expand Down

0 comments on commit 1e03122

Please sign in to comment.