aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-25 12:40:53 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-25 12:40:53 -0700
commit50b4f0cce070157f17435d07e35f9343b682fdf5 (patch)
tree11f6a8035f49e8c337e355f0d726fd84f1c20f2e /src/Text/Pandoc/Readers
parentd009a0fa525b6fa17bc34cf1a16f0b15c49366bd (diff)
downloadpandoc-50b4f0cce070157f17435d07e35f9343b682fdf5.tar.gz
Groff tokenizer: introduced type synonym for TableFormat.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Groff.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Groff.hs b/src/Text/Pandoc/Readers/Groff.hs
index 9609a490f..f26d86678 100644
--- a/src/Text/Pandoc/Readers/Groff.hs
+++ b/src/Text/Pandoc/Readers/Groff.hs
@@ -38,6 +38,7 @@ module Text.Pandoc.Readers.Groff
, LinePart(..)
, Arg
, TableOption
+ , TableFormat
, GroffToken(..)
, GroffTokens(..)
, linePartsToString
@@ -89,12 +90,13 @@ data LinePart = RoffStr String
type Arg = [LinePart]
type TableOption = (String, String)
+type TableFormat = String
-- TODO parse tables (see man tbl)
data GroffToken = MLine [LinePart]
| MEmptyLine
| MMacro MacroKind [Arg] SourcePos
- | MTable [TableOption] [[String]] [[GroffTokens]] SourcePos
+ | MTable [TableOption] [[TableFormat]] [[GroffTokens]] SourcePos
deriving Show
newtype GroffTokens = GroffTokens { unGroffTokens :: Seq.Seq GroffToken }
@@ -369,13 +371,13 @@ tableOption = do
optional (char ',')
return (k,v)
-tableFormatSpec :: PandocMonad m => GroffLexer m [[String]]
+tableFormatSpec :: PandocMonad m => GroffLexer m [[TableFormat]]
tableFormatSpec = do
speclines <- tableFormatSpecLine `sepBy1` (newline <|> char ',')
char '.'
return speclines
-tableFormatSpecLine :: PandocMonad m => GroffLexer m [String]
+tableFormatSpecLine :: PandocMonad m => GroffLexer m [TableFormat]
tableFormatSpecLine = do
as <- many1 $ skipMany spacetab >> tableColFormat
skipMany spacetab