Re: [GHC] #2046: Parse errors for mismatched brackets are awful

2008-01-16 Thread GHC
#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: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2046: Parse errors for mismatched brackets are awful

2008-01-16 Thread GHC
#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|  
---+
Changes (by simonmar):

  * component:  Compiler => Compiler (Parser)
  * difficulty:  => Unknown
  * status:  new => closed
  * resolution:  => duplicate

Comment:

 This is a long-standing problem, see #459 :-)

 The "possibly incorrect indentation" message arises because the token the
 parser is looking at is one that was generated by layout.  I honestly
 don't know whether there's anything we can easily do to improve matters in
 the context of the current parser, but I suspect not.

 Anyway, I propose to look at it next time I'm in the area.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2046: Parse errors for mismatched brackets are awful

2008-01-15 Thread GHC
#2046: Parse errors for mismatched brackets are awful
+---
Reporter:  NeilMitchell |Owner: 
Type:  feature request  |   Status:  new
Priority:  normal   |Milestone: 
   Component:  Compiler |  Version:  6.6.1  
Severity:  minor|   Resolution: 
Keywords:   | Testcase: 
Architecture:  Unknown  |   Os:  Unknown
+---
Comment (by tim):

 I agree with Neil. It has been a lifelong annoyance for me to not know
 whether that error message is *actually* due to incorrect indentation, or
 to mismatched brackets. I have no idea how hard it would be to improve
 this in the current parser, but from a user point of view, it can be
 enormously frustrating.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs