[GHC] #5401: LANGUAGE pragma parser nit

GHC ghc-devs at haskell.org
Sun Jul 20 18:39:12 UTC 2014


#5401: LANGUAGE pragma parser nit
-------------------------------------+-------------------------------------
              Reporter:  nwf         |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:  7.10.1
             Component:  Compiler    |           Version:  7.0.3
  (Parser)                           |          Keywords:
            Resolution:              |  Operating System:  Linux
Differential Revisions:              |   Type of failure:  GHC rejects
          Architecture:  x86_64      |  valid program
  (amd64)                            |         Test Case:
            Difficulty:  Unknown     |          Blocking:
            Blocked By:              |
       Related Tickets:              |
-------------------------------------+-------------------------------------
Description changed by thomie:

Old description:

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

New description:

 Language pragmas like
 {{{
 {-# LANGUAGE
     TypeOperators,
     FlexibleContexts #-}
 }}}
 or
 {{{
 {-# LANGUAGE
     TypeOperators,
     FlexibleContexts
   #-}
 }}}
 parse just fine but
 {{{
 {-# LANGUAGE
     TypeOperators,
     FlexibleContexts
 #-}
 }}}
 doesn't (note the missing spaces before the closing `#-}`), saying:
 {{{
     Cannot parse LANGUAGE pragma
     Expecting comma-separated list of language options,
     each starting with a capital letter
 }}}
 An OPTIONS_GHC pragma, on the other hand, accepts either format without
 complaint.

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/5401#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list