Opened 10 years ago

Closed 9 years ago

#4073 closed bug (duplicate)

Error with '#' at beginning of line in literate Haskell

Reported by: guest Owned by:
Priority: normal Milestone: 7.4.1
Component: Compiler Version: 6.12.1
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


When trying to load the attached file, I'm getting this error:

lexical error at character '\n'

pointing to the position of the first '#' in the file.

Attachments (1)

HaskellMonoidsAndTheirUses.lhs (32.3 KB) - added by guest 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by guest

comment:1 Changed 10 years ago by simonmar

GHC's unlit preprocessor leaves lines beginning with '#' in the output, so that you can use CPP directives in literate comments. It has always done that.

Arguably CPP should be run before unlit. I don't think I have a strong opinion, but it's entirely possible that would lead to some unforseen consequences; someone would need to try it.

comment:2 in reply to:  1 Changed 10 years ago by guest

Replying to simonmar:

I (the bug reporter) have no strong opinion either, but at least the error message could perhaps be made more helpful? I had no idea what the problem was (although it is obvious now that I know the reason), so I googled somewhat and found nothing, then I asked at Freenode's #haskell channel and John Millikin suggested I file a GHC bug, so here it is... Thanks for the feedback.

comment:3 Changed 10 years ago by igloo

Milestone: 6.16.1

comment:4 Changed 9 years ago by simonmar

Resolution: duplicate
Status: newclosed

#4836 is a dup of this, but has more useful info so let's keep that one instead.

Note: See TracTickets for help on using tickets.