These are chat archives for pest-parser/pest

8th
Feb 2018
jpathy
@jpathy
Feb 08 00:01
@Keats since ~ consumes comments/whitespaces in normal rules you could use ${} rule to prevent this behaviour and be explicit where you want comments/whitespaces
@dragostis The problem is it doesn't show the right alternation rule that failed. It says "expected foo, bar or baz" where the rule looks like top = { soi ~ (foo | bar | baz | rule_that_failed| .. ) ~ eoi} and the position is at the beginning of rule.
Vincent Prouillet
@Keats
Feb 08 10:09
@jpathy thanks I'll try, seems a bit of a hassle to mention whitespace everywhere though :(
Vincent Prouillet
@Keats
Feb 08 12:01
I ended up having it seemingly working by renaming comment to comments and sprinkle it everywhere it can happen
Julian Laubstein
@sphinxc0re
Feb 08 16:33

I have a problem with the parser generator. I am having trouble with the following rule:

mem = { "(" ~ "memory" ~ id? ~ memtype ~ ")" }

When I try to parse this:

"(memory 23 123)"

I'm getting the following error:

---- parser::tests::mem_test stdout ----
    thread 'parser::tests::mem_test' panicked at ' --> 1:9
  |
1 | (memory 23 123)
  |         ^---
  |
  = expected id', core/parser/mod.rs:38:74
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Note, that I'm only testing this specific rule

Vincent Prouillet
@Keats
Feb 08 17:02
what's the definition of id and memtype?
Julian Laubstein
@sphinxc0re
Feb 08 17:10
Nevermind ^^ I fixed the whole thing. Turned out to be a matter of order of rules