Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-06-11 Thread Antoine Latter
On Wed, May 30, 2012 at 5:47 PM, Roman Cheplyaka wrote: > > With this patch your code prints: > >    parse error at (line 1, column 7): >    unexpected "Hallofb", expecting one of ["Hello","Hallo","Foo","HallofFame"] > Hi folks, Roman's patch has been included in the newly-released parsec 3.1.3:

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-31 Thread Roman Cheplyaka
* Matthias Hörmann [2012-05-31 10:40:31+0200] > I noticed there are still some other problems in the code. In particular it > doesn't work as intended in cases > like this one: > > parseTest (do; r1 <- anyOf ["Hello", "Hallo", "Foo", "HallofFame"]; r2 <- > string "fbla"; return (r1, r2)) "Hallofb

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-31 Thread Matthias Hörmann
Hello Thanks for the quick help with this. I thought about the idea that lookAhead might be the cause of the positioning bug but then discarded that idea because I thought lookAhead should never lead to an error past wherever the input position is now considering it doesn't consume any input. I a

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-30 Thread Kevin Charter
Hi Antoine and Roman, On Wed, May 30, 2012 at 4:14 PM, Antoine Latter wrote: > We changed how 'try' handled errors in some cases in between 3.1.1 and > 3.1.2. I'll take a look at this. > > Antoine > Thanks for confirming -- I tried 3.1.2 and got the same result as Matthias. And Roman, thanks fo

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-30 Thread Roman Cheplyaka
* Matthias Hörmann [2012-05-30 21:36:13+0200] > And my question about this is made up of two parts > > 1. Why doesn't it print my "unexpected" message but instead says unknown > parse error > 2. Why is the location in the text off (I would expect it to fail at column > 6 (first character beyond t

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-30 Thread Antoine Latter
On Wed, May 30, 2012 at 4:18 PM, Kevin Charter wrote: > On Wed, May 30, 2012 at 3:11 PM, Kevin Charter wrote: >> >> What version of parsec 3 are you using? In version 3.1.1, I get (using >> Text.Parsec.String instead of Text.Parsec.Text): > > > Ah, answered my own question. I gather you're using

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-30 Thread Kevin Charter
On Wed, May 30, 2012 at 3:11 PM, Kevin Charter wrote: > What version of parsec 3 are you using? In version 3.1.1, I get (using > Text.Parsec.String instead of Text.Parsec.Text): > Ah, answered my own question. I gather you're using 3.1.2, since it's the first and so far only version with the Tex

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-30 Thread Kevin Charter
Hi Matthias, On Wed, May 30, 2012 at 1:36 PM, Matthias Hörmann wrote: > parseTest (do; r1 <- anyOf ["Hello", "Hallo", "Foo", "HallofFame"]; r2 <- > string "bla"; return (r1, r2)) "Hallofbla" > > which prints this: > > parse error at (line 1, column 8):unknown parse error > > And my question about