-
Hi I have the following parser: let byte = filter(char::is_ascii_hexdigit)
.repeated()
.exactly(2)
.collect::<String>()
.map(|v| u8::from_str_radix(&v, 16).unwrap());
let hex = byte
.chain(
just::<_, _, Simple<_>>(':')
.ignore_then(byte.separated_by(just(':')))
.or(byte.repeated()),
)
.then_ignore(end()); This hex parser parse either a byte string formatted either as "1a:2b:3c:4e" or "1a2b3c4e". I'm trying to move to the 1alpha version, and I see that the chain method on parser was removed. |
Beta Was this translation helpful? Give feedback.
Answered by
zesterer
Aug 2, 2023
Replies: 1 comment 9 replies
-
You should use |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right, in that case you can just put the separated case first: