Closed andrevidela closed 5 years ago
I also have a question for the
betweenopt
combinator.
You are right, this looks like a bug to me. In agdarsec the definition of between?
is the one you describe.
@gallais I replaced the implementation of betweenopt
by the suggested one.
Is it ready to be merged?
So I've looked into it and changed most of the phrasing to use the present tense rather than the imperative tense ("runs" instead of "run"). I've also changed the phrasing "this parses X" for a combinator rather than use the verbose (but more correct) formulation of "this function returns a parse that parses X"
I've added doc strings for most of the functions in
Combinators.idr
.Could you please review, and give feedback?
I also have a question for the
betweenopt
combinator.The current implementation is
landopt (roptand open p) close
. But doesn't this allow allow the surrounding parsers to be mismatched?For example
betweenopt (char "(") (exact "a") (char ")")
would match(a
, wouldn't it?