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 r...@ro-che.info 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

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

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

2012-05-31 Thread Roman Cheplyaka
* Matthias Hörmann mhoerm...@gmail.com [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))

[Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-30 Thread Matthias Hörmann
I recently started writing my first application at work in Haskell and it deals with a lot of parsing. Among other things I often have to check for a lot of alternatives for fixed strings (parsing natural language text and people have a lot of ways to abbreviate the same thing in labels). So far I

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 mhoerm...@gmail.comwrote: 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

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 kchar...@gmail.com 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

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 kchar...@gmail.com wrote: On Wed, May 30, 2012 at 3:11 PM, Kevin Charter kchar...@gmail.com 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

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

2012-05-30 Thread Roman Cheplyaka
* Matthias Hörmann mhoerm...@gmail.com [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

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 aslat...@gmail.com 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