Ticket #1091 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

parse error in comment {- | -}

Reported by: ravi@… Owned by: simonmar
Priority: normal Milestone: 6.8.1
Component: Compiler (Parser) Version: 6.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: read044 Blocked By:
Blocking: Related Tickets:

Description

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...

Attachments

Test.hs Download (122 bytes) - added by guest 6 years ago.
test case

Change History

Changed 6 years ago by guest

test case

Changed 6 years ago by igloo

  • milestone set to 6.8

It looks like it's being parsed as haddock documentation, but isn't in a valid place to be a haddock doc. I'm not sure what the right thing to do here is - document it as a divergence from Haskell 98 and perhaps improve the error message?

Changed 6 years ago by simonmar

  • owner set to simonmar

It shouldn't be parsed as Haddock unless the -fhaddock flag is on. I fixed one case of this recently, perhaps there are more. I'll take this one.

Changed 6 years ago by simonmar

  • status changed from new to closed
  • testcase set to read044
  • resolution set to fixed

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.1

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.