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
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
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
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