#4836: literate markdown not handled correctly by unlit
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:                           
        Type:  bug               |      Status:  new                      
    Priority:  normal            |   Component:  Compiler                 
     Version:  7.0.1             |    Keywords:                           
    Testcase:                    |   Blockedby:                           
          Os:  Unknown/Multiple  |    Blocking:                           
Architecture:  Unknown/Multiple  |     Failure:  GHC rejects valid program
---------------------------------+------------------------------------------

Comment(by nalaurethsulfate):

 while it might be easier to fix the cabal program also handles the same
 test case incorrectly:

 GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help[[BR]]

 Loading package ghc-prim ... linking ... done.[[BR]]

 Loading package integer-gmp ... linking ... done.[[BR]]

 Loading package base ... linking ... done.[[BR]]

 Prelude> :m Distribution.Simple.PreProcess.Unlit[[BR]]

 Prelude Distribution.Simple.PreProcess.Unlit> f <- readFile
 "test.lhs"[[BR]]

 Prelude Distribution.Simple.PreProcess.Unlit> f[[BR]]

 "### Ok so lets try this again.\n\n### A page that loads and
 compiles:\n\n> myfact 0
 = 1  \n> myfact n = n * n-1\n\nLets see if it works!\n"[[BR]]

 Prelude Distribution.Simple.PreProcess.Unlit> unlit "log.txt" f[[BR]]

 Loading package array-0.3.0.0 ... linking ... done.[[BR]]

 Loading package containers-0.3.0.0 ... linking ... done.[[BR]]

 Loading package filepath-1.1.0.3 ... linking ... done.[[BR]]

 Loading package old-locale-1.0.0.2 ... linking ... done.[[BR]]

 Loading package old-time-1.0.0.3 ... linking ... done. [[BR]]

 Loading package unix-2.4.0.0 ... linking ... done.[[BR]]

 Loading package directory-1.0.1.0 ... linking ... done.[[BR]]

 Loading package pretty-1.0.1.1 ... linking ... done.[[BR]]

 Loading package process-1.0.1.2 ... linking ... done.[[BR]]

 Loading package Cabal-1.8.0.2 ... linking ... done.[[BR]]

 Left "### Ok so lets try this again.\n\n### A page that loads and
 compiles:\n\n  myfact 0 = 1  \n  myfact n = n * n-1\n\n  -- Lets see if it
 works!\n\n"[[BR]]

 Prelude Distribution.Simple.PreProcess.Unlit> [[BR]]

 I don't think that this is terribly surprising though, and shouldn't be to
 difficult to fix. If someone could please explain why CPP lines wouldn't
 be in code blocks (no matter how they are delimited) that would help a
 lot.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to