Re: [Haskell-cafe] Re: Parsec is being weird at me
Chris Casinghino wrote:
On 8/25/07, Andrew Coppin <andrewcoppin@btinternet.com> wrote:
I thought the whole *purpose* of the endBy combinator was to keep applying one parser until the other one succeeds?
I don't think this is a lookahead problem, but rather just a misreading of the spec of endBy. Here it is:
(endBy p sep) parses zero or more occurrences of p, seperated and ended by sep. Returns a list of values returned by p.
The key text is "seperated and ended by sep". Not just ended by.
...so then what does sepEndBy do?
On 8/26/07, Andrew Coppin <andrewcoppin@btinternet.com> wrote:
...so then what does sepEndBy do?
With endBy, the sequence must end with the separator, with sepEndBy, the final occurrence of the separator is optional. The documentation here is very good: http://legacy.cs.uu.nl/daan/parsec.html --Chris
Chris Casinghino wrote:
On 8/26/07, Andrew Coppin <andrewcoppin@btinternet.com> wrote:
...so then what does sepEndBy do?
With endBy, the sequence must end with the separator, with sepEndBy, the final occurrence of the separator is optional.
Oh. I see... *sigh* Another wetware error. :-/
participants (2)
-
Andrew Coppin -
Chris Casinghino