Ticket #4073 (closed bug: duplicate)

Opened 3 years ago

Last modified 2 years ago

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 Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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

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

Change History

Changed 3 years ago by guest

follow-up: ↓ 2   Changed 3 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.

in reply to: ↑ 1   Changed 3 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.

  Changed 3 years ago by igloo

  • milestone set to 6.16.1

  Changed 2 years ago by simonmar

  • status changed from new to closed
  • resolution set to duplicate

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