[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Block comments in Haskell (PS).
Original-Via: uk.ac.ukc; Fri, 14 Sep 90 10:05:05 BST
From: Kent Karlsson <kent>
Date: Fri, 14 Sep 90 10:49:14 +0200
To: haskell@cs.glasgow.ac.uk
Subject: Block comments in Haskell (PS).
Original-Sender: kent%se.chalmers.cs@sunic.sunet.se
Sender: haskell-request@cs.glasgow.ac.uk
OOPS, still a glitch...
I wrote (wrongfully!)
ncomment -> {- {whitespace|string|{any} } -}
{ {any}( " | {- | -- | -} ){any} }
in the "first alternative", but that still makes e.g. "{- {- -}" and even "{- -} -}"
into *complete* ncomments. It should be the following productions instead:
ncomment -> {- junk {(whitespace|string) junk} -}
junk -> {any}
{ {any}( " | {- | -- | -} ){any} }
(where the "{" and "}" in "{-" and "-}" are not meta-characters)
(Sorry for not discovering this glitch yesterday... The "second alternative"
should *not* be changed, though the two alternatives (now) can be made to look more
alike by moving "white" around. So the "first alternative" could look like this:
ncomment -> {- junk {(comment|ncomment|string) junk} -}
junk -> {any | white}
{ {any | white}( " | {- | -- | -} ){any | white} }
white -> newline | space | tab | vertab | formfeed
whitestuff -> white | comment | ncomment
)
/kent k