diff options
author | Joe Crayne <joe@jerkface.net> | 2019-03-20 00:22:42 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-03-20 00:22:42 -0400 |
commit | 6efda02e8d3eb4c67d033fc2506fb5c76ab8ddfe (patch) | |
tree | ebb3bbf38d89ac4a2d02d36174553f500a5eac99 | |
parent | 5bfc85eaf313171c48860f41dd31ef10e0402b56 (diff) |
signatures
-rw-r--r-- | monkeypatch.hs | 3 |
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 | ||
50 | import Comments | 50 | import Comments |
51 | 51 | ||
52 | trace :: p -> a -> a | ||
52 | trace _ = id | 53 | trace _ = 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 | |||
460 | isFunctionDecl _ = False | 461 | isFunctionDecl _ = False |
461 | 462 | ||
462 | 463 | ||
464 | cleanTree :: (Functor f, Data (f b)) => f b -> f Ordering | ||
463 | cleanTree d = fmap (const LT) $ everywhere (mkT eraseNodeInfo) $ d | 465 | cleanTree d = fmap (const LT) $ everywhere (mkT eraseNodeInfo) $ d |
464 | 466 | ||
465 | transpile :: C2HaskellOptions -> FilePath -> IncludeStack -> CTranslationUnit NodeInfo -> IO () | 467 | transpile :: 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 | ||
1177 | doesReturnValue :: [CDeclarationSpecifier a] -> Bool | ||
1175 | doesReturnValue (CTypeSpec (CVoidType _):_) = False | 1178 | doesReturnValue (CTypeSpec (CVoidType _):_) = False |
1176 | doesReturnValue (x:xs) = doesReturnValue xs | 1179 | doesReturnValue (x:xs) = doesReturnValue xs |
1177 | doesReturnValue [] = True | 1180 | doesReturnValue [] = True |