@@ -115,9 +115,9 @@ parseBlock = choice [ parseList
115parseTable :: PandocMonad m => ManParser m Blocks
115parseTable :: PandocMonad m => ManParser m Blocks
116parseTable = do
116parseTable = do
117 modifyState $ \st -> st { tableCellsPlain = True }
117 modifyState $ \st -> st { tableCellsPlain = True }
118− let isRoffTable (RoffTable{}) = True
118+ let isTbl (Tbl{}) = True
119− isRoffTable _ = False
119+ isTbl _ = False
120− RoffTable _opts rows pos <- msatisfy isRoffTable
120+ Tbl _opts rows pos <- msatisfy isTbl
121 case rows of
121 case rows of
122 ((as,_):_) -> try (do
122 ((as,_):_) -> try (do
123 let as' = map (columnTypeToAlignment . columnType) as
123 let as' = map (columnTypeToAlignment . columnType) as
@@ -167,7 +167,7 @@ parseTable = do
167 isHrule ([cellfmt], _) = columnType cellfmt `elem` ['_','-','=']
167 isHrule ([cellfmt], _) = columnType cellfmt `elem` ['_','-','=']
168 isHrule (_, [RoffTokens ss]) =
168 isHrule (_, [RoffTokens ss]) =
169 case Foldable.toList ss of
169 case Foldable.toList ss of
170− [RoffTextLine [RoffStr [c]]] -> c `elem` ['_','-','=']
170+ [TextLine [RoffStr [c]]] -> c `elem` ['_','-','=']
171 _ -> False
171 _ -> False
172 isHrule _ = False
172 isHrule _ = False
@@ -199,7 +199,7 @@ msatisfy :: Monad m => (RoffToken -> Bool) -> ParserT [RoffToken] st m RoffToken
199msatisfy predic = tokenPrim show nextPos testTok
199msatisfy predic = tokenPrim show nextPos testTok
201 testTok t = if predic t then Just t else Nothing
201 testTok t = if predic t then Just t else Nothing
202− nextPos _pos _x (RoffControlLine _ _ pos':_) = pos'
202+ nextPos _pos _x (ControlLine _ _ pos':_) = pos'
203 nextPos pos _x _xs = updatePosString
203 nextPos pos _x _xs = updatePosString
204 (setSourceColumn
204 (setSourceColumn
205 (setSourceLine pos $ sourceLine pos + 1) 1) ""
205 (setSourceLine pos $ sourceLine pos + 1) 1) ""
@@ -208,25 +208,25 @@ mtoken :: PandocMonad m => ManParser m RoffToken
208mtoken = msatisfy (const True)
208mtoken = msatisfy (const True)
210mline :: PandocMonad m => ManParser m RoffToken
210mline :: PandocMonad m => ManParser m RoffToken
211−mline = msatisfy isRoffTextLine where
211+mline = msatisfy isTextLine where
212− isRoffTextLine (RoffTextLine _) = True
212+ isTextLine (TextLine _) = True
213− isRoffTextLine _ = False
213+ isTextLine _ = False
215memptyLine :: PandocMonad m => ManParser m RoffToken
215memptyLine :: PandocMonad m => ManParser m RoffToken
216−memptyLine = msatisfy isRoffEmptyLine where
216+memptyLine = msatisfy isEmptyLine where
217− isRoffEmptyLine RoffEmptyLine = True
217+ isEmptyLine EmptyLine = True
218− isRoffEmptyLine _ = False
218+ isEmptyLine _ = False
220mmacro :: PandocMonad m => String -> ManParser m RoffToken
220mmacro :: PandocMonad m => String -> ManParser m RoffToken
221−mmacro mk = msatisfy isRoffControlLine where
221+mmacro mk = msatisfy isControlLine where
222− isRoffControlLine (RoffControlLine mk' _ _) | mk == mk' = True
222+ isControlLine (ControlLine mk' _ _) | mk == mk' = True
223 | otherwise = False
223 | otherwise = False
224− isRoffControlLine _ = False
224+ isControlLine _ = False
226mmacroAny :: PandocMonad m => ManParser m RoffToken
226mmacroAny :: PandocMonad m => ManParser m RoffToken
227−mmacroAny = msatisfy isRoffControlLine where
227+mmacroAny = msatisfy isControlLine where
228− isRoffControlLine RoffControlLine{} = True
228+ isControlLine ControlLine{} = True
229− isRoffControlLine _ = False
229+ isControlLine _ = False
232-- RoffToken -> Block functions
232-- RoffToken -> Block functions
@@ -234,7 +234,7 @@ mmacroAny = msatisfy isRoffControlLine where
235parseTitle :: PandocMonad m => ManParser m Blocks
235parseTitle :: PandocMonad m => ManParser m Blocks
236parseTitle = do
236parseTitle = do
237− (RoffControlLine _ args _) <- mmacro "TH"
237+ (ControlLine _ args _) <- mmacro "TH"
238 let adjustMeta =
238 let adjustMeta =
239 case args of
239 case args of
240 (x:y:z:_) -> setMeta "title" (linePartsToInlines x) .
240 (x:y:z:_) -> setMeta "title" (linePartsToInlines x) .
@@ -305,8 +305,8 @@ parseInline :: PandocMonad m => ManParser m Inlines
305parseInline = try $ do
305parseInline = try $ do
306 tok <- mtoken
306 tok <- mtoken
307 case tok of
307 case tok of
308− RoffTextLine lparts -> return $ linePartsToInlines lparts
308+ TextLine lparts -> return $ linePartsToInlines lparts
309− RoffControlLine mname args pos -> handleInlineMacro mname args pos
309+ ControlLine mname args pos -> handleInlineMacro mname args pos
310 _ -> mzero
310 _ -> mzero
312handleInlineMacro :: PandocMonad m
312handleInlineMacro :: PandocMonad m
@@ -337,14 +337,14 @@ handleInlineMacro mname args _pos = do
338parseBold :: PandocMonad m => [Arg] -> ManParser m Inlines
338parseBold :: PandocMonad m => [Arg] -> ManParser m Inlines
339parseBold [] = do
339parseBold [] = do
340− RoffTextLine lparts <- mline
340+ TextLine lparts <- mline
341 return $ strong $ linePartsToInlines lparts
341 return $ strong $ linePartsToInlines lparts
342parseBold args = return $
342parseBold args = return $
343 strong $ mconcat $ intersperse B.space $ map linePartsToInlines args
343 strong $ mconcat $ intersperse B.space $ map linePartsToInlines args
345parseItalic :: PandocMonad m => [Arg] -> ManParser m Inlines
345parseItalic :: PandocMonad m => [Arg] -> ManParser m Inlines
346parseItalic [] = do
346parseItalic [] = do
347− RoffTextLine lparts <- mline
347+ TextLine lparts <- mline
348 return $ emph $ linePartsToInlines lparts
348 return $ emph $ linePartsToInlines lparts
349parseItalic args = return $
349parseItalic args = return $
350 emph $ mconcat $ intersperse B.space $ map linePartsToInlines args
350 emph $ mconcat $ intersperse B.space $ map linePartsToInlines args
@@ -358,12 +358,12 @@ parseAlternatingFonts constructors args = return $ mconcat $
359lineInl :: PandocMonad m => ManParser m Inlines
359lineInl :: PandocMonad m => ManParser m Inlines
360lineInl = do
360lineInl = do
361− (RoffTextLine fragments) <- mline
361+ (TextLine fragments) <- mline
362 return $ linePartsToInlines fragments
362 return $ linePartsToInlines fragments
364bareIP :: PandocMonad m => ManParser m RoffToken
364bareIP :: PandocMonad m => ManParser m RoffToken
365bareIP = msatisfy isBareIP where
365bareIP = msatisfy isBareIP where
366− isBareIP (RoffControlLine "IP" [] _) = True
366+ isBareIP (ControlLine "IP" [] _) = True
367 isBareIP _ = False
367 isBareIP _ = False
369endmacro :: PandocMonad m => String -> ManParser m ()
369endmacro :: PandocMonad m => String -> ManParser m ()
@@ -372,8 +372,8 @@ endmacro name = void (mmacro name)
372 <|> lookAhead eof
372 <|> lookAhead eof
374 newBlockMacro = msatisfy isNewBlockMacro
374 newBlockMacro = msatisfy isNewBlockMacro
375− isNewBlockMacro (RoffControlLine "SH" _ _) = True
375+ isNewBlockMacro (ControlLine "SH" _ _) = True
376− isNewBlockMacro (RoffControlLine "SS" _ _) = True
376+ isNewBlockMacro (ControlLine "SS" _ _) = True
377 isNewBlockMacro _ = False
377 isNewBlockMacro _ = False
379parseCodeBlock :: PandocMonad m => ManParser m Blocks
379parseCodeBlock :: PandocMonad m => ManParser m Blocks
@@ -390,16 +390,16 @@ parseCodeBlock = try $ do
390 codeline = do
390 codeline = do
391 tok <- mtoken
391 tok <- mtoken
392 case tok of
392 case tok of
393− RoffControlLine "PP" _ _ -> return $ Just "" -- .PP sometimes used for blank line
393+ ControlLine "PP" _ _ -> return $ Just "" -- .PP sometimes used for blank line
394− RoffControlLine mname args pos -> do
394+ ControlLine mname args pos -> do
395 (Just . query getText <$> handleInlineMacro mname args pos) <|>
395 (Just . query getText <$> handleInlineMacro mname args pos) <|>
396 do report $ SkippedContent ('.':mname) pos
396 do report $ SkippedContent ('.':mname) pos
397 return Nothing
397 return Nothing
398− RoffTable _ _ pos -> do
398+ Tbl _ _ pos -> do
399 report $ SkippedContent "TABLE" pos
399 report $ SkippedContent "TABLE" pos
400 return $ Just "TABLE"
400 return $ Just "TABLE"
401− RoffEmptyLine -> return $ Just ""
401+ EmptyLine -> return $ Just ""
402− RoffTextLine ss
402+ TextLine ss
403 | not (null ss)
403 | not (null ss)
404 , all isFontToken ss -> return Nothing
404 , all isFontToken ss -> return Nothing
405 | otherwise -> return $ Just $ linePartsToString ss
405 | otherwise -> return $ Just $ linePartsToString ss
@@ -417,7 +417,7 @@ parseCodeBlock = try $ do
418parseHeader :: PandocMonad m => ManParser m Blocks
418parseHeader :: PandocMonad m => ManParser m Blocks
419parseHeader = do
419parseHeader = do
420− RoffControlLine name args _ <- mmacro "SH" <|> mmacro "SS"
420+ ControlLine name args _ <- mmacro "SH" <|> mmacro "SS"
421 contents <- if null args
421 contents <- if null args
422 then lineInl
422 then lineInl
423 else return $ mconcat $ intersperse B.space
423 else return $ mconcat $ intersperse B.space
@@ -440,7 +440,7 @@ listTypeMatches (Just _) _ = False
441listItem :: PandocMonad m => Maybe ListType -> ManParser m (ListType, Blocks)
441listItem :: PandocMonad m => Maybe ListType -> ManParser m (ListType, Blocks)
442listItem mbListType = try $ do
442listItem mbListType = try $ do
443− (RoffControlLine _ args _) <- mmacro "IP"
443+ (ControlLine _ args _) <- mmacro "IP"
444 case args of
444 case args of
445 (arg1 : _) -> do
445 (arg1 : _) -> do
446 let cs = linePartsToString arg1
446 let cs = linePartsToString arg1
@@ -491,7 +491,7 @@ parseDefinitionList = definitionList <$> many1 definitionListItem
491parseLink :: PandocMonad m => [Arg] -> ManParser m Inlines
491parseLink :: PandocMonad m => [Arg] -> ManParser m Inlines
492parseLink args = do
492parseLink args = do
493 contents <- mconcat <$> many lineInl
493 contents <- mconcat <$> many lineInl
494− RoffControlLine _ endargs _ <- mmacro "UE"
494+ ControlLine _ endargs _ <- mmacro "UE"
495 let url = case args of
495 let url = case args of
497 (x:_) -> linePartsToString x
497 (x:_) -> linePartsToString x
@@ -503,7 +503,7 @@ parseLink args = do
503parseEmailLink :: PandocMonad m => [Arg] -> ManParser m Inlines
503parseEmailLink :: PandocMonad m => [Arg] -> ManParser m Inlines
504parseEmailLink args = do
504parseEmailLink args = do
505 contents <- mconcat <$> many lineInl
505 contents <- mconcat <$> many lineInl
506− RoffControlLine _ endargs _ <- mmacro "ME"
506+ ControlLine _ endargs _ <- mmacro "ME"
507 let url = case args of
507 let url = case args of
509 (x:_) -> "mailto:" ++ linePartsToString x
509 (x:_) -> "mailto:" ++ linePartsToString x
@@ -516,7 +516,7 @@ skipUnkownMacro :: PandocMonad m => ManParser m Blocks
516skipUnkownMacro = do
516skipUnkownMacro = do
517 tok <- mmacroAny
517 tok <- mmacroAny
518 case tok of
518 case tok of
519− RoffControlLine mkind _ pos -> do
519+ ControlLine mkind _ pos -> do
520 report $ SkippedContent ('.':mkind) pos
520 report $ SkippedContent ('.':mkind) pos
521 return mempty
521 return mempty
522 _ -> fail "the impossible happened"
522 _ -> fail "the impossible happened"