-
Hi all! TL;DR Why is whitespace still part of the result even though I have a silent I'm trying to parse the following input (Rust 1.73.0, Pest 2.7.7):
My test program (source code is below) yields the following, note that it includes whitespace:
My Pest file contains:
My Rust code is the following:
I expected the whitespace to be stripped from the result, but it turns out it isn't. My goal is to place the num/value in a data structure. I'm sure I am doing something wrong. Can someone help me? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Mmm, this seems to be the same problem as stated in #396. Changing the Pest file to:
Seems to prevent the issue. |
Beta Was this translation helpful? Give feedback.
-
It turns out that you need to opt-in the
I understand the need to keep old grammars working, but perhaps this should be added to the documentation in some way: I'd expect you to want this behaviour for new projects. Finally, apologies for raising a new discussion and not finding the prior discussions/issues. I guess I didn't look hard enough. |
Beta Was this translation helpful? Give feedback.
It turns out that you need to opt-in the
grammar-extras
feature for pest_derive:I understand the need to keep old grammars working, but perhaps this should be added to the documentation in some way: I'd expect you to want this behaviour for new projects.
Finally, apologies for raising a new discussion and not finding the prior discussions/issues. I guess I didn't look hard enough.