git.iko.soy/typeable/pandoc
on master help sign in
Updates for compiling with ghc 7.

We now use a CPP trick to have compatible quasiquotes that work in both GHC 6.12 and 7.

commitc5384a33c0488d7e1274ba5579a24cf733eee934 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 26 Jan 2011, 09:09 (16 years ago) parent422bba2
3 files changed+13−7
pandoc.cabal+7−3 tests/Tests/Helpers.hs+5−3 tests/Tests/Writers/ConTeXt.hs+1−1
pandoc.cabal+7−3
@@ -330,7 +330,11 @@ Executable test-pandoc
330330 Hs-Source-Dirs: tests, src
331331 Main-Is: test-pandoc.hs
332332 if flag(highlighting)
333− cpp-options: -D_HIGHLIGHTING
333+ cpp-options: -D_HIGHLIGHTING
334+ if impl(ghc >= 7)
335+ cpp-options: -D_LIT=lit
336+ else
337+ cpp-options: -D_LIT=$lit
334338 if !flag(tests)
335339 Buildable: False
336340 else
@@ -342,9 +346,9 @@ Executable test-pandoc
342346 Build-Depends: base >= 4 && < 5, Diff, test-framework >= 0.3 && < 0.4,
343347 test-framework-hunit >= 0.2 && < 0.3,
344348 test-framework-quickcheck2 >= 0.2.9 && < 0.3,
345− QuickCheck == 2.4.*,
349+ QuickCheck >= 2.4 && < 2.6,
346350 HUnit >= 1.2 && < 1.3,
347− template-haskell == 2.4.*,
351+ template-haskell >= 2.4 && < 2.6,
348352 ansi-terminal == 0.5.*
349353 Other-Modules: Tests.Old
350354 Tests.Helpers
tests/Tests/Helpers.hs+5−3
@@ -20,15 +20,17 @@ import Test.HUnit (assertBool)
2020import Text.Pandoc.Shared (normalize, defaultWriterOptions,
2121 WriterOptions(..), removeTrailingSpace)
2222import Text.Pandoc.Writers.Native (writeNative)
23−import Language.Haskell.TH.Quote
23+import Language.Haskell.TH.Quote (QuasiQuoter(..))
2424import Language.Haskell.TH.Syntax (Q, runIO)
2525import qualified Test.QuickCheck.Property as QP
2626import System.Console.ANSI
2727import Data.Algorithm.Diff
2828
2929lit :: QuasiQuoter
30−lit = QuasiQuoter ((\a -> let b = rnl a in [|b|]) . filter (/= '\r')) $
31− error "Cannot use lit as a pattern"
30+lit = QuasiQuoter {
31+ quoteExp = (\a -> let b = rnl a in [|b|]) . filter (/= '\r')
32+ , quotePat = error "Cannot use lit as a pattern"
33+ }
3234 where rnl ('\n':xs) = xs
3335 rnl xs = xs
3436
tests/Tests/Writers/ConTeXt.hs+1−1
@@ -52,7 +52,7 @@ tests = [ testGroup "inline code"
5252 bulletList [plain (text "top")
5353 ,bulletList [plain (text "next")
5454 ,bulletList [plain (text "bot")]]]
55− =?> [$lit|
55+ =?> [_LIT|
5656\startitemize
5757\item
5858 top