[GHC] #1091: parse error in comment {- | -}

GHC trac at galois.com
Mon Jan 8 06:18:03 EST 2007


#1091: parse error in comment {- | -}
----------------------------------+-----------------------------------------
    Reporter:  ravi at bluespec.com  |       Owner:         
        Type:  bug                |      Status:  new    
    Priority:  normal             |   Milestone:         
   Component:  Compiler (Parser)  |     Version:  6.7    
    Severity:  minor              |    Keywords:         
  Difficulty:  Unknown            |    Testcase:         
Architecture:  Unknown            |          Os:  Unknown
----------------------------------+-----------------------------------------
Decided to try out the latest HEAD and discovered that my code was
 triggering a parse error ... in a comment.

 The comment commented out a guard in a case expression, and the | seems to
 trigger the parse error. Even odder, it doesn't always trigger a parse
 error (my first attempt to reproduce the issue with a "Hello World"
 program failed and you can see one {- | -} comment that doesn't trigger a
 parse error and one that does in the attached test case.

 Release ghc 6.6 deals with all of these cases just fine, so I presume it
 is some sort of silly regression. It's just an annoying one because it
 makes it harder to comment out code when you want to.

 An even odder thing, that I wasn't going to mention until I could
 reproduce it is that the HEAD ghc segfaults if you run it on the attached
 file after ghc 6.6 has generated a .hi file for it. I would have expected
 an error about incompatible .hi file versions...

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


More information about the Glasgow-haskell-bugs mailing list