Re: [Haskell-cafe] Optional EOF in Parsec.

2009-04-04 Thread Stephan Friedrichs
Kannan Goundan wrote: I'm writing a parser with Parsec. In the input language, elements of a sequence are separated by commas: [1, 2, 3] However, instead of a comma, you can also use an EOL: [1, 2 3] Anywhere else, EOL is considered ignorable whitespace. So it's not as

Re: [Haskell-cafe] Optional EOF in Parsec.

2009-04-04 Thread Martijn van Steenbergen
Kannan Goundan wrote: I've implemented this functionality in a hand-written parser (basically a hack that keeps track of whether the last read token was preceded by an EOL, without making EOL itself a token). Does anybody have ideas about how to do this with Parsec? You can do exactly the

[Haskell-cafe] Optional EOF in Parsec.

2009-04-03 Thread Kannan Goundan
I'm writing a parser with Parsec. In the input language, elements of a sequence are separated by commas: [1, 2, 3] However, instead of a comma, you can also use an EOL: [1, 2 3] Anywhere else, EOL is considered ignorable whitespace. So it's not as simple as just making EOL a token

Re: [Haskell-cafe] Optional EOF in Parsec.

2009-04-03 Thread Antoine Latter
On Fri, Apr 3, 2009 at 8:17 PM, Kannan Goundan kan...@cakoose.com wrote: I'm writing a parser with Parsec.  In the input language, elements of a sequence are separated by commas:   [1, 2, 3] However, instead of a comma, you can also use an EOL:  [1, 2  3] Anywhere else, EOL is