From 50b4f0cce070157f17435d07e35f9343b682fdf5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 25 Oct 2018 12:40:53 -0700 Subject: Groff tokenizer: introduced type synonym for TableFormat. --- src/Text/Pandoc/Readers/Groff.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3