[GHC] #10230: multiline literals doesn't work with CPP extension.

GHC ghc-devs at haskell.org
Thu Apr 2 18:53:39 UTC 2015


#10230: multiline literals doesn't work with CPP extension.
-------------------------------------+-------------------------------------
              Reporter:  qnikst      |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.10.1
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 If LANGUAGE CPP is enabled then multiline literals stops working.
 Steps to reproduce.
 1. write a program with multiline literal: cat 1.hs
 {{{#!hs
 test = "mutli\
    \line"

 main = putStrLn test
 }}}
 2. it should compile without CPP:
  ghc 1.hs
 [1 of 1] Compiling Main             ( 1.hs, 1.o )
 Linking 1 ...
 3. compile it with CPP extension

 Expected result: program compiles
 {{{
 ghc 1.hs
 [1 of 1] Compiling Main             ( 1.hs, 1.o )
 Linking 1 ...
 }}}

 Actual result: compilation breaks
 {{{
 ghc -XCPP 1.hs
 [1 of 1] Compiling Main             ( 1.hs, 1.o ) [flags changed]

 1.hs:1:18:
     lexical error in string/character literal at character 'l'
 }}}

 At least ghc-7.8.4 and ghc-7.10 are affected.

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


More information about the ghc-tickets mailing list