<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>No newlines in the whitespace for Parsec lexeme parsers</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi,<BR>
<BR>
I'm looking to parse a Fortran dialect using Parsec, and was hoping to use the ParsecToken module. Fortran though is unlike the Parsec examples, and prohibits default line continuation (requiring instead an explicit ampersand token &amp;). The lexical parsers of the ParsecToken module skip whitespace after each symbol parsed (lexeme parsers); including the newline.<BR>
<BR>
I was thinking of making a minor change to Parsec: In Token.hs, lexeme, whiteSpace, and simpleSpace are defined. lexeme uses whiteSpace which uses simpleSpace. simpleSpace is defined:<BR>
<BR>
simpleSpace = skipMany1 (satisfy isSpace)<BR>
<BR>
I could replace this locally with:<BR>
<BR>
simpleSpace = skipMany1 (satisfy isSpacePlusAmpersandMinusNewline)<BR>
<BR>
This approach may have other problems though. Has anyone experience of using Parsec to parse such a language? For example assembly or a preprocessor?<BR>
<BR>
Thanks in advance,<BR>
Paul</FONT>
</P>

</BODY>
</HTML>