Replies: 2 comments
-
I think you should just be able to use let uppercase_char = filter(|c: &char| c.is_uppercase());
let spec_name = just::<_, _, Simple<char>>('#')
.ignore_then(uppercase_char.ignored().rewind())
.ignore_then(text::ident()).parse("#Treehouse"); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Regarding the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to match an ident that begins with an uppercase. I need to the result to be in a complete form, including all the tokens matched in one string. Closest I can get to doing this
This still results in
Ok(((), "Treehouse"))
. The tuple, having a first item of()
, is undesirable. I could probably also useto
to convert it to the desired result. Ideally, it should only beOk("Treehouse")
. Seems like this needs aand
primitive that allows for chaining multiple methods that match tokens in sequence, each with their own predicate, then collates the result as a single output.just("a").and(just("b")).and(just("c")).parse("abc")
should giveOk("abc")
.Currently,
just('a').then(just('b')).then(just('c')).parse("abc")
givesOk((('a', 'b'), 'c'))
. The tuples here are highly undesirable for me.Beta Was this translation helpful? Give feedback.
All reactions