[Haskell-cafe] Parsec : Problems with operator precedence
Erik de Castro Lopo
mle+cl at mega-nerd.com
Mon Dec 29 06:10:11 EST 2008
Daniel Fischer wrote:
> The problem is that "|" is a prefix of "||" and it gets the first bite. So
> when the parser gets to "||" it first tries to parse a bitwise or. That
> succeeds. Then the parser is looking for an operand, but it finds the second
> - unexpected - "|". I don't remember how Parsec's expression parsers work,
> maybe you can add a "try" some parser(s) to make it work.
I've did try a 'try' but that didn't help.
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Whenever the C++ language designers had two competing ideas as to
how they should solve some problem, they said, "OK, we'll do them
both". So the language is too baroque for my taste." -- Donald E Knuth
More information about the Haskell-Cafe
mailing list