Merge pull request #35 from alanz/dev

Fix haddock generation.
pull/46/head
Lennart Spitzner 2017-07-07 13:52:17 +02:00 committed by GitHub
commit f43b96d920
4 changed files with 8 additions and 8 deletions

View File

@ -207,10 +207,10 @@ layoutExpr lexpr@(L _ expr) = docWrapNode lexpr $ case expr of
-- this case rather leads to some unfortunate layouting than to anything -- this case rather leads to some unfortunate layouting than to anything
-- useful; disabling for now. (it interfers with cols stuff.) -- useful; disabling for now. (it interfers with cols stuff.)
-- , docSetBaseY -- , docSetBaseY
-- $ docPar -- - $ docPar
-- leftOperandDoc -- leftOperandDoc
-- ( docLines -- ( docLines
-- $ (appListDocs <&> \(od, ed) -> docCols ColOpPrefix [appSep od, docSetBaseY ed]) -- - $ (appListDocs <&> \(od, ed) -> docCols ColOpPrefix [appSep od, docSetBaseY ed])
-- ++ [docCols ColOpPrefix [appSep opLastDoc, docSetBaseY expLastDoc]] -- ++ [docCols ColOpPrefix [appSep opLastDoc, docSetBaseY expLastDoc]]
-- ) -- )
, docPar , docPar

View File

@ -130,11 +130,11 @@ layoutPat lpat@(L _ pat) = docWrapNode lpat $ case pat of
NPat llit@(L _ (OverLit olit _ _ _)) _ _ _ -> do NPat llit@(L _ (OverLit olit _ _ _)) _ _ _ -> do
fmap Seq.singleton $ docWrapNode llit $ allocateNode $ overLitValBriDoc olit fmap Seq.singleton $ docWrapNode llit $ allocateNode $ overLitValBriDoc olit
-- #if MIN_VERSION_ghc(8,0,0) -- if MIN_VERSION_ghc(8,0,0)
-- VarPat n -> return $ stringLayouter lpat $ lrdrNameToText n -- VarPat n -> return $ stringLayouter lpat $ lrdrNameToText n
-- #else -- else
-- VarPat n -> return $ stringLayouter lpat $ rdrNameToText n -- VarPat n -> return $ stringLayouter lpat $ rdrNameToText n
-- #endif -- endif
_ -> fmap return $ briDocByExactInlineOnly "some unknown pattern" lpat _ -> fmap return $ briDocByExactInlineOnly "some unknown pattern" lpat
colsWrapPat :: Seq BriDocNumbered -> ToBriDocM BriDocNumbered colsWrapPat :: Seq BriDocNumbered -> ToBriDocM BriDocNumbered

View File

@ -224,7 +224,7 @@ transformAlts briDoc =
++ ",lineCheck=" ++ show (lineCheck vs) ++ ",lineCheck=" ++ show (lineCheck vs)
++ " " ++ show (toConstr bd) ++ " " ++ show (toConstr bd)
#endif #endif
id -- $ (fmap $ \x -> traceShow (briDocToDoc x) x) id -- - $ (fmap $ \x -> traceShow (briDocToDoc x) x)
$ rec $ rec
$ fromMaybe (-- trace ("choosing last") $ $ fromMaybe (-- trace ("choosing last") $
List.last alts) List.last alts)
@ -262,7 +262,7 @@ transformAlts briDoc =
++ " " ++ show (toConstr bd) ++ " " ++ show (toConstr bd)
tellDebugMess $ " " ++ show (Data.Maybe.mapMaybe (fmap fst) checkedOptions) tellDebugMess $ " " ++ show (Data.Maybe.mapMaybe (fmap fst) checkedOptions)
#endif #endif
id -- $ (fmap $ \x -> traceShow (briDocToDoc x) x) id -- - $ (fmap $ \x -> traceShow (briDocToDoc x) x)
$ rec $ rec
$ fromMaybe (-- trace ("choosing last") $ $ fromMaybe (-- trace ("choosing last") $
List.last alts) List.last alts)

View File

@ -119,7 +119,7 @@ customLayouterF anns layoutF =
occName = simpleLayouter . ("{OccName: "++) . (++"}") . OccName.occNameString occName = simpleLayouter . ("{OccName: "++) . (++"}") . OccName.occNameString
srcSpan :: GHC.SrcSpan -> NodeLayouter srcSpan :: GHC.SrcSpan -> NodeLayouter
srcSpan ss = simpleLayouter srcSpan ss = simpleLayouter
-- $ "{"++ showSDoc_ (GHC.ppr ss)++"}" -- - $ "{"++ showSDoc_ (GHC.ppr ss)++"}"
$ "{" ++ showGhc ss ++ "}" $ "{" ++ showGhc ss ++ "}"
located :: (Data b, Data loc) => GHC.GenLocated loc b -> NodeLayouter located :: (Data b, Data loc) => GHC.GenLocated loc b -> NodeLayouter
located (GHC.L ss a) = runDataToLayouter layoutF $ A annStr a located (GHC.L ss a) = runDataToLayouter layoutF $ A annStr a