Hello Kaspar,

I was wondering if such a patch would make sense:

  
https://github.com/jmettraux/parslet/commit/d01ed604d158498635924ed1063f7fc27837ce81

The motivation behind it is that I find myself writing code like:

---8<---
def parse(s)

  reporter = Parslet::ErrorReporter::Deepest.new

  MyParser.new.parse(s, :reporter => reporter)

rescue Parslet::ParseFailed => pf

  raise(
    ParseError,
    reporter.deepest_cause.to_s,
    pf.backtrace)
end
--->8---

whereas the Parslet examples are more like:

---8<---
def parse(s)

  MyParser.new.parse(s, :reporter => Parslet::ErrorReporter::Deepest.new)
end
--->8---

which would match nicely with the #deepest(given) returning the deepest_cause
instead of the given cause.

Wdyt?

--
John Mettraux - http://lambda.io/jmettraux

Reply via email to