Opened 3 years ago

Last modified 9 months ago

#5401 new bug

LANGUAGE pragma parser nit

Reported by: nwf Owned by:
Priority: normal Milestone: 7.6.2
Component: Compiler (Parser) Version: 7.0.3
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: GHC rejects valid program Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo)

A language pragma like

{-# LANGUAGE 
    TypeOperators,
    FlexibleContexts #-}

parses just fine but

{-# LANGUAGE 
    TypeOperators,
    FlexibleContexts
#-}

doesn't, saying:

    Cannot parse LANGUAGE pragma
    Expecting comma-separated list of language options,
    each starting with a capital letter

An OPTIONS pragma, on the other hand, accepts either format without complaint.

Change History (5)

comment:1 Changed 3 years ago by daniel.is.fischer

The user's guide says

The layout rule applies in pragmas, so the closing #-} should start in a column to the right of the opening {-#.

The language report doesn't mention any such restrictions though, so perhaps it should be listed in Bugs and infelicities (supposing the parse can't easily be changed to accept the #-} anywhere).

comment:2 Changed 2 years ago by igloo

  • Milestone set to 7.6.1
  • Owner set to igloo

comment:3 Changed 19 months ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:4 Changed 18 months ago by igloo

  • Description modified (diff)
  • Difficulty set to Unknown

comment:5 Changed 9 months ago by igloo

  • Owner igloo deleted
Note: See TracTickets for help on using tickets.