[GHC] #999: Misattributed parse error in do block
GHC
trac at galois.com
Mon Nov 13 07:59:50 EST 2006
#999: Misattributed parse error in do block
--------------------------------+-------------------------------------------
Reporter: red5_2 at hotmail.com | Owner:
Type: bug | Status: new
Priority: normal | Milestone: _|_
Component: Compiler (Parser) | Version: 6.4.2
Severity: normal | Resolution:
Keywords: | Difficulty: Moderate (1 day)
Testcase: | Architecture: Unknown
Os: Unknown |
--------------------------------+-------------------------------------------
Changes (by simonmar):
* difficulty: Unknown => Moderate (1 day)
* milestone: => _|_
Comment:
This happens because the closing bracket ends the layout for the do-block,
via Haskell's parse-error layout convention. This causes the do-block to
be checked, before getting back to parsing the rest of the file.
If you use `-ferror-spans`, then you get the position of the start and end
of the statement.
To fix this we would probably have to postpone checking the syntax of a
do-expression until the renamer. This isn't easy, because the `HsDo`
constructor already has separate fields for statements and "body"
(although I'm not sure why).
This bug is very closely related to #984. I'll leave it low prio for now.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/999>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list