[project @ 2001-04-23 19:34:57 by lewie]
authorlewie <unknown>
Mon, 23 Apr 2001 19:34:57 +0000 (19:34 +0000)
committerlewie <unknown>
Mon, 23 Apr 2001 19:34:57 +0000 (19:34 +0000)
commitb5f00004d9ac04dee3d36a72374e9712fbc87a13
tree4cf38d2834df4465de22d3e8126311cc20ed8878
parent23c27aa22426b980a2bd8c68e013673e23051a3f
[project @ 2001-04-23 19:34:57 by lewie]
Fix for infix decl w/ infix data constructor.
GHC was rejecting this:

    infix 2 |-
    ps  |-  q:qs = undefined

It parses the def as ((ps |- q) : qs), and doesn't have the fixity info
around at the point where it decides what is being defined.  Lacking
anything else to go on, it decides that `:' is being defined.

Fortunately, we don't really need fixity info to parse this correctly,
as a data constructor is always the wrong choice ;-)  The fix is to
dive into the left-hand-side until we find a non-data constructor.

This is naive - consider the case where `|-' has a high precedence.
Fortunately, someone clever put in a static check later on, presumably
at the point where we have all the fixity info, that rejects the definition
as bogus.  Yeah!
ghc/compiler/parser/ParseUtil.lhs