These are chat archives for pest-parser/pest

18th
Dec 2017
James Harton
@jamesotron
Dec 18 2017 00:45
I copied comment = _{ "#" ~ (!newline ~ any)* } from one of the examples, but I am getting an unexpected parse error:
Attempting to parse "# wat\n1"
thread 'builder::test::test_comment' panicked at 'called `Result::unwrap()` on an `Err` value: ParsingError { positives: [statements], negatives: [], pos: Position { pos: 7 } }', src/libcore/result.rs:906:4
DragoČ™ Tiselice
@dragostis
Dec 18 2017 11:39
It may be a bit unwieldy, but comment rules are run between rules. If you want to have comments before/after your main rule, make sure to add soi/eoi to your grammar. This also makes the grammar fail if the parser fails to consume all input.
James Harton
@jamesotron
Dec 18 2017 19:14
Yes. My topmost production does exactly that.
DragoČ™ Tiselice
@dragostis
Dec 18 2017 20:52
Are you still getting the error? May I see the test?
James Harton
@jamesotron
Dec 18 2017 22:06
Sure am.
2 sec
The parser always enters at the input rule.