[GHC] #2046: Parse errors for mismatched brackets are awful
GHC
trac at galois.com
Wed Jan 16 07:39:33 EST 2008
#2046: Parse errors for mismatched brackets are awful
-------------------------------+--------------------------------------------
Reporter: NeilMitchell | Owner:
Type: feature request | Status: closed
Priority: normal | Milestone:
Component: Compiler (Parser) | Version: 6.6.1
Severity: minor | Resolution: duplicate
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown
Os: Unknown |
-------------------------------+--------------------------------------------
Comment (by NeilMitchell):
A simple fix would be that if the parsing fails with a "possibly incorrect
indentation" style warning, you rerun the lexer over the original file,
without inserting symbols based on indentation. After you have this raw
lexical stream, you do a simple scan with a bracket stack and check
everything matches up. If it doesn't, you give a very precise error
indicating exactly which bracket was not match. If it does, you fall back
to the same situation we have now.
Assuming the lexer is sufficiently modular, this should be easy (at a
guess), and not complicate any other part of the compiler.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2046#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list