summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-07-25 20:08:42 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-07-25 20:08:42 -0700
commit1dba82f25ee17590bf03b00659662240460b7824 (patch)
treebe3651aa25289a5b5263a6e3de951deed8314ea2
parent95570ba34c4e7675295b6eefcfcc4dac4ac720af (diff)
Got rid of stateStandalone, which was hardly used anyway.
The only possible effect will be with rst fragments that begin with an rst title block, which will now cause the header transform.
-rw-r--r--Benchmark.hs7
-rw-r--r--src/Tests/Readers/Markdown.hs2
-rw-r--r--src/Tests/Readers/RST.hs2
-rw-r--r--src/Text/Pandoc/Parsing.hs2
-rw-r--r--src/Text/Pandoc/Readers/RST.hs4
-rw-r--r--src/pandoc.hs1
6 files changed, 7 insertions, 11 deletions
diff --git a/Benchmark.hs b/Benchmark.hs
index 1fd787945..e7ff718e5 100644
--- a/Benchmark.hs
+++ b/Benchmark.hs
@@ -9,8 +9,8 @@ readerBench :: Pandoc
-> Benchmark
readerBench doc (name, reader) =
let writer = case lookup name writers of
- Just w -> w
- Nothing -> error $ "Could not find writer for " ++ name
+ Just (PureStringWriter w) -> w
+ _ -> error $ "Could not find writer for " ++ name
inp = writer defaultWriterOptions{ writerWrapText = True
, writerLiterateHaskell =
"+lhs" `isSuffixOf` name } doc
@@ -41,5 +41,6 @@ main = do
let ps = defaultParserState{ stateSmart = True }
let doc = readMarkdown ps inp
let readerBs = map (readerBench doc) readers
- defaultMain $ map (writerBench doc) writers ++ readerBs ++ normalizeBench doc
+ let writers' = [(n,w) | (n, PureStringWriter w) <- writers]
+ defaultMain $ map (writerBench doc) writers' ++ readerBs ++ normalizeBench doc
diff --git a/src/Tests/Readers/Markdown.hs b/src/Tests/Readers/Markdown.hs
index 8462558a9..e6612f475 100644
--- a/src/Tests/Readers/Markdown.hs
+++ b/src/Tests/Readers/Markdown.hs
@@ -10,7 +10,7 @@ import Text.Pandoc.Builder
import Text.Pandoc
markdown :: String -> Pandoc
-markdown = readMarkdown defaultParserState{ stateStandalone = True }
+markdown = readMarkdown defaultParserState
markdownSmart :: String -> Pandoc
markdownSmart = readMarkdown defaultParserState{ stateOptions =
diff --git a/src/Tests/Readers/RST.hs b/src/Tests/Readers/RST.hs
index 3269092a6..5601731a0 100644
--- a/src/Tests/Readers/RST.hs
+++ b/src/Tests/Readers/RST.hs
@@ -9,7 +9,7 @@ import Text.Pandoc.Builder
import Text.Pandoc
rst :: String -> Pandoc
-rst = readRST defaultParserState{ stateStandalone = True }
+rst = readRST defaultParserState
infix 4 =:
(=:) :: ToString c
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index dd73e01ee..9c553a9ed 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -695,7 +695,6 @@ data ParserState = ParserState
stateKeys :: KeyTable, -- ^ List of reference keys
stateCitations :: [String], -- ^ List of available citations
stateNotes :: NoteTable, -- ^ List of notes
- stateStandalone :: Bool, -- ^ Parse bibliographic info?
stateTitle :: [Inline], -- ^ Title of document
stateAuthors :: [[Inline]], -- ^ Authors of document
stateDate :: [Inline], -- ^ Date of document
@@ -724,7 +723,6 @@ defaultParserState =
stateKeys = M.empty,
stateCitations = [],
stateNotes = [],
- stateStandalone = False,
stateTitle = [],
stateAuthors = [],
stateDate = [],
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index b017b736b..39da6de6a 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -106,9 +106,7 @@ parseRST = do
blocks <- parseBlocks
let blocks' = filter (/= Null) blocks
state <- getState
- let (blocks'', title) = if stateStandalone state
- then titleTransform blocks'
- else (blocks', [])
+ let (blocks'', title) = titleTransform blocks'
let authors = stateAuthors state
let date = stateDate state
let title' = if (null title) then (stateTitle state) else title
diff --git a/src/pandoc.hs b/src/pandoc.hs
index 8fb9e293b..ba8c19dad 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -938,7 +938,6 @@ main = do
let startParserState = def{ stateLiterateHaskell = "+lhs" `isSuffixOf` readerName' ||
lhsExtension sources,
- stateStandalone = standalone',
stateCitations = map CSL.refId refs,
stateOptions = def{
readerStrict = strict