summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-03-20 00:22:42 -0400
committerJoe Crayne <joe@jerkface.net>2019-03-20 00:22:42 -0400
commit6efda02e8d3eb4c67d033fc2506fb5c76ab8ddfe (patch)
treeebb3bbf38d89ac4a2d02d36174553f500a5eac99
parent5bfc85eaf313171c48860f41dd31ef10e0402b56 (diff)
signatures
-rw-r--r--monkeypatch.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/monkeypatch.hs b/monkeypatch.hs
index 7806f07..e4ccbc1 100644
--- a/monkeypatch.hs
+++ b/monkeypatch.hs
@@ -49,6 +49,7 @@ import Text.Show.Pretty
49 49
50import Comments 50import Comments
51 51
52trace :: p -> a -> a
52trace _ = id 53trace _ = id
53 54
54-- | Pretty print the given tranlation unit, but replace declarations from header files with @#include@ directives. 55-- | Pretty print the given tranlation unit, but replace declarations from header files with @#include@ directives.
@@ -460,6 +461,7 @@ isFunctionDecl (CFDefExt (CFunDef _ _ _ (CCompound [] _ _) _)) = True
460isFunctionDecl _ = False 461isFunctionDecl _ = False
461 462
462 463
464cleanTree :: (Functor f, Data (f b)) => f b -> f Ordering
463cleanTree d = fmap (const LT) $ everywhere (mkT eraseNodeInfo) $ d 465cleanTree d = fmap (const LT) $ everywhere (mkT eraseNodeInfo) $ d
464 466
465transpile :: C2HaskellOptions -> FilePath -> IncludeStack -> CTranslationUnit NodeInfo -> IO () 467transpile :: C2HaskellOptions -> FilePath -> IncludeStack -> CTranslationUnit NodeInfo -> IO ()
@@ -1172,6 +1174,7 @@ setBody bdy (CDeclExt (CDecl xs ys pos)) = (CFDefExt (CFunDef xs v [] bdy p
1172 _ -> CDeclr Nothing [] Nothing [] pos 1174 _ -> CDeclr Nothing [] Nothing [] pos
1173 1175
1174 1176
1177doesReturnValue :: [CDeclarationSpecifier a] -> Bool
1175doesReturnValue (CTypeSpec (CVoidType _):_) = False 1178doesReturnValue (CTypeSpec (CVoidType _):_) = False
1176doesReturnValue (x:xs) = doesReturnValue xs 1179doesReturnValue (x:xs) = doesReturnValue xs
1177doesReturnValue [] = True 1180doesReturnValue [] = True