Layout rule

Ian Lynagh [email protected]
Sun, 30 Sep 2001 20:46:51 +0100

Hi all

The report says "The layout rule matches only those open braces that it
has inserted" in the lexical structure section. However, in the syntax
section function L starts

L (t:ts) (m:ms) = } : (L (t:ts) ms) if parse-error(t) (Note 1)

which AFAICT will implicitly close an explicit open brace. Testing with
"foo = let { x = 5 in x" shows hugs, ghc and nhc98 all seem to agree
with me.

L (t:ts) (m:ms) = } : (L (t:ts) ms) if m /= 0 && parse-error(t) (Note 1)

Along similar lines, I think writing the last two lines as

L [] [0] = []
L [] (m:ms) = } : L [] ms if m /=0 (Note 5)

would be clearer. In fact as the preeceding text says 'and "" for the
empty stream' I think it may be written correctly but have gotten lost
in the conversion from whatever it is really written in.