git.iko.soy/typeable/pandoc
on master help sign in
Groff tokenizer: introduced type synonym for TableFormat.
commit50b4f0cce070157f17435d07e35f9343b682fdf5 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 25 Oct 2018, 12:40 (8 years ago) parentd009a0f
1 file changed+5−3
src/Text/Pandoc/Readers/Groff.hs+5−3
src/Text/Pandoc/Readers/Groff.hs+5−3
@@ -38,6 +38,7 @@ module Text.Pandoc.Readers.Groff
3838 , LinePart(..)
3939 , Arg
4040 , TableOption
41+ , TableFormat
4142 , GroffToken(..)
4243 , GroffTokens(..)
4344 , linePartsToString
@@ -89,12 +90,13 @@ data LinePart = RoffStr String
8990
9091type Arg = [LinePart]
9192type TableOption = (String, String)
93+type TableFormat = String
9294
9395-- TODO parse tables (see man tbl)
9496data GroffToken = MLine [LinePart]
9597 | MEmptyLine
9698 | MMacro MacroKind [Arg] SourcePos
97− | MTable [TableOption] [[String]] [[GroffTokens]] SourcePos
99+ | MTable [TableOption] [[TableFormat]] [[GroffTokens]] SourcePos
98100 deriving Show
99101
100102newtype GroffTokens = GroffTokens { unGroffTokens :: Seq.Seq GroffToken }
@@ -369,13 +371,13 @@ tableOption = do
369371 optional (char ',')
370372 return (k,v)
371373
372−tableFormatSpec :: PandocMonad m => GroffLexer m [[String]]
374+tableFormatSpec :: PandocMonad m => GroffLexer m [[TableFormat]]
373375tableFormatSpec = do
374376 speclines <- tableFormatSpecLine `sepBy1` (newline <|> char ',')
375377 char '.'
376378 return speclines
377379
378−tableFormatSpecLine :: PandocMonad m => GroffLexer m [String]
380+tableFormatSpecLine :: PandocMonad m => GroffLexer m [TableFormat]
379381tableFormatSpecLine = do
380382 as <- many1 $ skipMany spacetab >> tableColFormat
381383 skipMany spacetab