From dfa4b76630837560189844eb79c83abcb619b0f6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Aug 2012 23:18:19 -0700 Subject: Changes to literate haskell options. - Removed writerLiterateHaskell from WriterOptions. - Removed readerLiterateHaskell from ReaderOptions. - Added Ext_literate_haskell to Extensions. Test for this instead of the above. - Removed failUnlessLHS from Shared. Note: At this point, +lhs and .lhs extension no longer has any effect. Need to fix. --- benchmark/benchmark-pandoc.hs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'benchmark') diff --git a/benchmark/benchmark-pandoc.hs b/benchmark/benchmark-pandoc.hs index 7dbd29bed..728e45b56 100644 --- a/benchmark/benchmark-pandoc.hs +++ b/benchmark/benchmark-pandoc.hs @@ -2,7 +2,6 @@ import Text.Pandoc import Text.Pandoc.Shared (readDataFile, normalize) import Criterion.Main import Criterion.Config -import Data.List (isSuffixOf) import Text.JSON.Generic import System.Environment (getArgs) import Data.Monoid @@ -14,24 +13,18 @@ readerBench doc (name, reader) = let writer = case lookup name writers of Just (PureStringWriter w) -> w _ -> error $ "Could not find writer for " ++ name - inp = writer def{ writerWrapText = True - , writerLiterateHaskell = - "+lhs" `isSuffixOf` name } doc + inp = writer def{ writerWrapText = True } doc -- we compute the length to force full evaluation getLength (Pandoc (Meta a b c) d) = length a + length b + length c + length d in bench (name ++ " reader") $ whnf (getLength . - reader def{ readerSmart = True - , readerLiterateHaskell = "+lhs" `isSuffixOf` name - }) inp + reader def{ readerSmart = True }) inp writerBench :: Pandoc -> (String, WriterOptions -> Pandoc -> String) -> Benchmark writerBench doc (name, writer) = bench (name ++ " writer") $ nf - (writer def{ - writerWrapText = True - , writerLiterateHaskell = "+lhs" `isSuffixOf` name }) doc + (writer def{ writerWrapText = True }) doc normalizeBench :: Pandoc -> [Benchmark] normalizeBench doc = [ bench "normalize - with" $ nf (encodeJSON . normalize) doc -- cgit v1.2.3