[GHC] #984: Syntax error shows in the wrong position

GHC cvs-ghc at haskell.org
Fri Feb 1 17:18:29 CET 2013


#984: Syntax error shows in the wrong position
-------------------------------------+--------------------------------------
    Reporter:  guest                 |       Owner:                  
        Type:  bug                   |      Status:  new             
    Priority:  low                   |   Milestone:  _|_             
   Component:  Compiler (Parser)     |     Version:  6.4.2           
    Keywords:  syntax parse case do  |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple      |     Failure:  None/Unknown    
  Difficulty:  Unknown               |    Testcase:  N/A             
   Blockedby:                        |    Blocking:                  
     Related:                        |  
-------------------------------------+--------------------------------------

Comment(by ian@…):

 commit d2169af1b312c698ade627c26416a7527f1c46b1
 {{{
 Author: Ian Lynagh <ian at well-typed.com>
 Date:   Fri Feb 1 15:23:39 2013 +0000

     Improve an error message; fixes #984

     This code:
         f _ = do
                 x <- computation
                 case () of
                         _ ->
                                 result <- computation
                                 case () of () -> undefined
     Now gives this error:
         Parse error in pattern: case () of { _ -> result }
         Possibly caused by a missing 'do'?

  compiler/parser/Parser.y.pp  |   22 +++++----
  compiler/parser/RdrHsSyn.lhs |  108
 ++++++++++++++++++++++--------------------
  2 files changed, 70 insertions(+), 60 deletions(-)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/984#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list