You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wanted to suggest to modify slightly to the recognize example, as the ordering of the output type is not obvious to me
Here is my suggestion:
use nom::combinator::recognize;use nom::character::complete::{char, alpha1};use nom::sequence::separated_pair;letmut parser = recognize(separated_pair(alpha1,char(','), alpha1));assert_eq!(parser("abcd,efgh_"), Ok(("_", "abcd,efgh")));// 'abcd,efgh' is consumed, _ is leftassert_eq!(parser("abcd;"),Err(Err::Error((";", ErrorKind::Char))));// Missing second part
The text was updated successfully, but these errors were encountered:
Hi !
Just wanted to suggest to modify slightly to the
recognize
example, as the ordering of the output type is not obvious to meHere is my suggestion:
The text was updated successfully, but these errors were encountered: