These are chat archives for pest-parser/pest

25th
Feb 2017
Sunjay Varma
@sunjay
Feb 25 2017 03:22
I'm having a problem with using the parser. It seems that if I have any leading/trailing whitespace, the parser immediately fails
Is this a bug in pest or something I should be handling in my code?
I think that since pest handles ignoring whitespace/comments it should do so before anything is parsed as well
Though I'm willing to change my mind based on what you think
DragoČ™ Tiselice
@dragostis
Feb 25 2017 09:03
That's why I've introduced the soi and eoi rules. Whitespace is matched only between rules, so you can use those in order to match leaving and ending whitespace.
I find matching whitespace only between rules and subrules to be way more predictable and controllable.
Sunjay Varma
@sunjay
Feb 25 2017 17:40
Oh I never noticed soi. That's very cool. How does that work? I already have a top level rule that uses eoi. Do I just include soi at the start of that rule? Will that skip the leading whitespace?
Actually, nevermind. After thinking about it that makes perfect sense
It will match the leading whitespace because then the whitespace will be between soi and the first token. That's a brilliant solution! Nice work!
DragoČ™ Tiselice
@dragostis
Feb 25 2017 18:38
Thanks! Credit goes to early adopters helping me out. :)