-
Hi all! I'm wondering if it is possible to pattern match match pair {
Pair(Rule::binary_expression, [left, right]) => {
// left and right are of type Pair and can be matched further
}
} I've tried to build my own convenience layer of structs and traits on top, but can't overcome the borrow checker. Any advice appreciated. |
Beta Was this translation helpful? Give feedback.
Answered by
tomtau
Oct 13, 2022
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tomtau
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pair
's parts are private, so it's not possible to match on them directly. As for "matching parser results convenience", I'd suggest checking out some of the existing crates, such as pest_consume or pest-ast.