aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-22 15:10:21 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-22 15:10:21 -0800
commitbbad12906632291d146a8ad634309a689c3b46af (patch)
tree792703fc7942f4344b3ac56a5f70e06a0936d3c5
parent4ba3afbb4d55af23116f5882e18549ea1f228216 (diff)
downloadpandoc-bbad12906632291d146a8ad634309a689c3b46af.tar.gz
RST reader: recouped speed loss due to addition of --smart.
This was achieved by rearranging the parsers in inline. Benchmarks went from 500ms to 307ms -- not quite back to the 279ms we had in 1.6, before supporting smart punctuation and footnotes, but close.
-rw-r--r--src/Text/Pandoc/Readers/RST.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index e929e2b91..1b0365c72 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -709,8 +709,7 @@ table = gridTable False <|> simpleTable False <|>
--
inline :: GenParser Char ParserState Inline
-inline = choice [ smartPunctuation inline
- , link
+inline = choice [ link
, str
, whitespace
, endline
@@ -718,11 +717,12 @@ inline = choice [ smartPunctuation inline
, emph
, code
, image
- , hyphens
, superscript
, subscript
- , escapedChar
, note
+ , smartPunctuation inline
+ , hyphens
+ , escapedChar
, symbol ] <?> "inline"
hyphens :: GenParser Char ParserState Inline