aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-09-24 14:37:54 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-09-24 14:37:54 +0300
commitcd610da8ccf3af925dd5d501902590a634c22b34 (patch)
tree9d0f14da3d18aadf258904cd6b9c18cf5eebde52 /src/Text/Pandoc/Readers
parent6d16ea9c76799e1303dde6cea13406ea62c10439 (diff)
downloadpandoc-cd610da8ccf3af925dd5d501902590a634c22b34.tar.gz
Muse reader: replace inlineList with inline'
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index e5b0f5f33..6475669ce 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -225,7 +225,7 @@ parseEmacsDirective :: PandocMonad m => MuseParser m (String, F Inlines)
parseEmacsDirective = (,)
<$> parseDirectiveKey
<* spaceChar
- <*> (trimInlinesF . mconcat <$> manyTill (choice inlineList) eol)
+ <*> (trimInlinesF . mconcat <$> manyTill inline' eol)
parseAmuseDirective :: PandocMonad m => MuseParser m (String, F Inlines)
parseAmuseDirective = (,)
@@ -455,7 +455,7 @@ playTag = do
verseLine :: PandocMonad m => MuseParser m (F Inlines)
verseLine = do
indent <- (B.str <$> many1 ('\160' <$ char ' ')) <|> pure mempty
- rest <- manyTill (choice inlineList) newline
+ rest <- manyTill inline' newline
return $ trimInlinesF $ mconcat (pure indent : rest)
-- | Parse @\<verse>@ tag.
@@ -546,7 +546,7 @@ lineVerseLine = try $ do
string "> "
indent <- many ('\160' <$ char ' ')
let indentEl = if null indent then mempty else B.str indent
- rest <- manyTill (choice inlineList) eol
+ rest <- manyTill inline' eol
return $ trimInlinesF $ mconcat (pure indentEl : rest)
blanklineVerseLine :: PandocMonad m => MuseParser m (F Inlines)
@@ -648,7 +648,7 @@ definitionListItemsUntil indent end =
where
continuation = try $ do
pos <- getPosition
- term <- trimInlinesF . mconcat <$> manyTill (choice inlineList) (try $ string "::")
+ term <- trimInlinesF . mconcat <$> manyTill inline' (try $ string "::")
(x, (xs, e)) <- descriptionsUntil (sourceColumn pos) (try (optional blankline *> indentWith indent *> continuation) <|> (([],) <$> end))
let xx = (,) <$> term <*> sequence x
return (xx:xs, e)
@@ -753,33 +753,33 @@ tableParseCaption = try $ fmap MuseCaption . trimInlinesF . mconcat
-- ** Inline parsers
-inlineList :: PandocMonad m => [MuseParser m (F Inlines)]
-inlineList = [ whitespace
- , br
- , anchor
- , footnote
- , strong
- , strongTag
- , emph
- , emphTag
- , underlined
- , superscriptTag
- , subscriptTag
- , strikeoutTag
- , verbatimTag
- , classTag
- , nbsp
- , linkOrImage
- , code
- , codeTag
- , mathTag
- , inlineLiteralTag
- , str
- , symbol
- ]
+inline' :: PandocMonad m => MuseParser m (F Inlines)
+inline' = whitespace
+ <|> br
+ <|> anchor
+ <|> footnote
+ <|> strong
+ <|> strongTag
+ <|> emph
+ <|> emphTag
+ <|> underlined
+ <|> superscriptTag
+ <|> subscriptTag
+ <|> strikeoutTag
+ <|> verbatimTag
+ <|> classTag
+ <|> nbsp
+ <|> linkOrImage
+ <|> code
+ <|> codeTag
+ <|> mathTag
+ <|> inlineLiteralTag
+ <|> str
+ <|> symbol
+ <?> "inline"
inline :: PandocMonad m => MuseParser m (F Inlines)
-inline = endline <|> choice inlineList <?> "inline"
+inline = endline <|> inline'
-- | Parse a soft break.
endline :: PandocMonad m => MuseParser m (F Inlines)