@@ -115,9 +115,9 @@ parseBlock = choice [ parseList
115115parseTable :: PandocMonad m => ManParser m Blocks
116116parseTable = do
117117 modifyState $ \st -> st { tableCellsPlain = True }
118− let isRoffTable (RoffTable{}) = True
119− isRoffTable _ = False
120− RoffTable _opts rows pos <- msatisfy isRoffTable
118+ let isTbl (Tbl{}) = True
119+ isTbl _ = False
120+ Tbl _opts rows pos <- msatisfy isTbl
121121 case rows of
122122 ((as,_):_) -> try (do
123123 let as' = map (columnTypeToAlignment . columnType) as
@@ -167,7 +167,7 @@ parseTable = do
167167 isHrule ([cellfmt], _) = columnType cellfmt `elem` ['_','-','=']
168168 isHrule (_, [RoffTokens ss]) =
169169 case Foldable.toList ss of
170− [RoffTextLine [RoffStr [c]]] -> c `elem` ['_','-','=']
170+ [TextLine [RoffStr [c]]] -> c `elem` ['_','-','=']
171171 _ -> False
172172 isHrule _ = False
173173
@@ -199,7 +199,7 @@ msatisfy :: Monad m => (RoffToken -> Bool) -> ParserT [RoffToken] st m RoffToken
199199msatisfy predic = tokenPrim show nextPos testTok
200200 where
201201 testTok t = if predic t then Just t else Nothing
202− nextPos _pos _x (RoffControlLine _ _ pos':_) = pos'
202+ nextPos _pos _x (ControlLine _ _ pos':_) = pos'
203203 nextPos pos _x _xs = updatePosString
204204 (setSourceColumn
205205 (setSourceLine pos $ sourceLine pos + 1) 1) ""
@@ -208,25 +208,25 @@ mtoken :: PandocMonad m => ManParser m RoffToken
208208mtoken = msatisfy (const True)
209209
210210mline :: PandocMonad m => ManParser m RoffToken
211−mline = msatisfy isRoffTextLine where
212− isRoffTextLine (RoffTextLine _) = True
213− isRoffTextLine _ = False
211+mline = msatisfy isTextLine where
212+ isTextLine (TextLine _) = True
213+ isTextLine _ = False
214214
215215memptyLine :: PandocMonad m => ManParser m RoffToken
216−memptyLine = msatisfy isRoffEmptyLine where
217− isRoffEmptyLine RoffEmptyLine = True
218− isRoffEmptyLine _ = False
216+memptyLine = msatisfy isEmptyLine where
217+ isEmptyLine EmptyLine = True
218+ isEmptyLine _ = False
219219
220220mmacro :: PandocMonad m => String -> ManParser m RoffToken
221−mmacro mk = msatisfy isRoffControlLine where
222− isRoffControlLine (RoffControlLine mk' _ _) | mk == mk' = True
221+mmacro mk = msatisfy isControlLine where
222+ isControlLine (ControlLine mk' _ _) | mk == mk' = True
223223 | otherwise = False
224− isRoffControlLine _ = False
224+ isControlLine _ = False
225225
226226mmacroAny :: PandocMonad m => ManParser m RoffToken
227−mmacroAny = msatisfy isRoffControlLine where
228− isRoffControlLine RoffControlLine{} = True
229− isRoffControlLine _ = False
227+mmacroAny = msatisfy isControlLine where
228+ isControlLine ControlLine{} = True
229+ isControlLine _ = False
230230
231231--
232232-- RoffToken -> Block functions
@@ -234,7 +234,7 @@ mmacroAny = msatisfy isRoffControlLine where
234234
235235parseTitle :: PandocMonad m => ManParser m Blocks
236236parseTitle = do
237− (RoffControlLine _ args _) <- mmacro "TH"
237+ (ControlLine _ args _) <- mmacro "TH"
238238 let adjustMeta =
239239 case args of
240240 (x:y:z:_) -> setMeta "title" (linePartsToInlines x) .
@@ -305,8 +305,8 @@ parseInline :: PandocMonad m => ManParser m Inlines
305305parseInline = try $ do
306306 tok <- mtoken
307307 case tok of
308− RoffTextLine lparts -> return $ linePartsToInlines lparts
309− RoffControlLine mname args pos -> handleInlineMacro mname args pos
308+ TextLine lparts -> return $ linePartsToInlines lparts
309+ ControlLine mname args pos -> handleInlineMacro mname args pos
310310 _ -> mzero
311311
312312handleInlineMacro :: PandocMonad m
@@ -337,14 +337,14 @@ handleInlineMacro mname args _pos = do
337337
338338parseBold :: PandocMonad m => [Arg] -> ManParser m Inlines
339339parseBold [] = do
340− RoffTextLine lparts <- mline
340+ TextLine lparts <- mline
341341 return $ strong $ linePartsToInlines lparts
342342parseBold args = return $
343343 strong $ mconcat $ intersperse B.space $ map linePartsToInlines args
344344
345345parseItalic :: PandocMonad m => [Arg] -> ManParser m Inlines
346346parseItalic [] = do
347− RoffTextLine lparts <- mline
347+ TextLine lparts <- mline
348348 return $ emph $ linePartsToInlines lparts
349349parseItalic args = return $
350350 emph $ mconcat $ intersperse B.space $ map linePartsToInlines args
@@ -358,12 +358,12 @@ parseAlternatingFonts constructors args = return $ mconcat $
358358
359359lineInl :: PandocMonad m => ManParser m Inlines
360360lineInl = do
361− (RoffTextLine fragments) <- mline
361+ (TextLine fragments) <- mline
362362 return $ linePartsToInlines fragments
363363
364364bareIP :: PandocMonad m => ManParser m RoffToken
365365bareIP = msatisfy isBareIP where
366− isBareIP (RoffControlLine "IP" [] _) = True
366+ isBareIP (ControlLine "IP" [] _) = True
367367 isBareIP _ = False
368368
369369endmacro :: PandocMonad m => String -> ManParser m ()
@@ -372,8 +372,8 @@ endmacro name = void (mmacro name)
372372 <|> lookAhead eof
373373 where
374374 newBlockMacro = msatisfy isNewBlockMacro
375− isNewBlockMacro (RoffControlLine "SH" _ _) = True
376− isNewBlockMacro (RoffControlLine "SS" _ _) = True
375+ isNewBlockMacro (ControlLine "SH" _ _) = True
376+ isNewBlockMacro (ControlLine "SS" _ _) = True
377377 isNewBlockMacro _ = False
378378
379379parseCodeBlock :: PandocMonad m => ManParser m Blocks
@@ -390,16 +390,16 @@ parseCodeBlock = try $ do
390390 codeline = do
391391 tok <- mtoken
392392 case tok of
393− RoffControlLine "PP" _ _ -> return $ Just "" -- .PP sometimes used for blank line
394− RoffControlLine mname args pos -> do
393+ ControlLine "PP" _ _ -> return $ Just "" -- .PP sometimes used for blank line
394+ ControlLine mname args pos -> do
395395 (Just . query getText <$> handleInlineMacro mname args pos) <|>
396396 do report $ SkippedContent ('.':mname) pos
397397 return Nothing
398− RoffTable _ _ pos -> do
398+ Tbl _ _ pos -> do
399399 report $ SkippedContent "TABLE" pos
400400 return $ Just "TABLE"
401− RoffEmptyLine -> return $ Just ""
402− RoffTextLine ss
401+ EmptyLine -> return $ Just ""
402+ TextLine ss
403403 | not (null ss)
404404 , all isFontToken ss -> return Nothing
405405 | otherwise -> return $ Just $ linePartsToString ss
@@ -417,7 +417,7 @@ parseCodeBlock = try $ do
417417
418418parseHeader :: PandocMonad m => ManParser m Blocks
419419parseHeader = do
420− RoffControlLine name args _ <- mmacro "SH" <|> mmacro "SS"
420+ ControlLine name args _ <- mmacro "SH" <|> mmacro "SS"
421421 contents <- if null args
422422 then lineInl
423423 else return $ mconcat $ intersperse B.space
@@ -440,7 +440,7 @@ listTypeMatches (Just _) _ = False
440440
441441listItem :: PandocMonad m => Maybe ListType -> ManParser m (ListType, Blocks)
442442listItem mbListType = try $ do
443− (RoffControlLine _ args _) <- mmacro "IP"
443+ (ControlLine _ args _) <- mmacro "IP"
444444 case args of
445445 (arg1 : _) -> do
446446 let cs = linePartsToString arg1
@@ -491,7 +491,7 @@ parseDefinitionList = definitionList <$> many1 definitionListItem
491491parseLink :: PandocMonad m => [Arg] -> ManParser m Inlines
492492parseLink args = do
493493 contents <- mconcat <$> many lineInl
494− RoffControlLine _ endargs _ <- mmacro "UE"
494+ ControlLine _ endargs _ <- mmacro "UE"
495495 let url = case args of
496496 [] -> ""
497497 (x:_) -> linePartsToString x
@@ -503,7 +503,7 @@ parseLink args = do
503503parseEmailLink :: PandocMonad m => [Arg] -> ManParser m Inlines
504504parseEmailLink args = do
505505 contents <- mconcat <$> many lineInl
506− RoffControlLine _ endargs _ <- mmacro "ME"
506+ ControlLine _ endargs _ <- mmacro "ME"
507507 let url = case args of
508508 [] -> ""
509509 (x:_) -> "mailto:" ++ linePartsToString x
@@ -516,7 +516,7 @@ skipUnkownMacro :: PandocMonad m => ManParser m Blocks
516516skipUnkownMacro = do
517517 tok <- mmacroAny
518518 case tok of
519− RoffControlLine mkind _ pos -> do
519+ ControlLine mkind _ pos -> do
520520 report $ SkippedContent ('.':mkind) pos
521521 return mempty
522522 _ -> fail "the impossible happened"