diff options
Diffstat (limited to 'monkeypatch.hs')
-rw-r--r-- | monkeypatch.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/monkeypatch.hs b/monkeypatch.hs index eefc525..98ebe38 100644 --- a/monkeypatch.hs +++ b/monkeypatch.hs | |||
@@ -359,6 +359,14 @@ grokStatement (CBlockStmt (CReturn (Just exp) _)) = do | |||
359 | let k = uniqIdentifier "go" (compFree x `Map.union` compIntro x) | 359 | let k = uniqIdentifier "go" (compFree x `Map.union` compIntro x) |
360 | x' = fmap (\y -> App () (hsvar "return") y) x | 360 | x' = fmap (\y -> App () (hsvar "return") y) x |
361 | return $ fmap (\y -> Lambda () [hspvar k] y) $ foldr applyComputation x' xs | 361 | return $ fmap (\y -> Lambda () [hspvar k] y) $ foldr applyComputation x' xs |
362 | grokStatement (CBlockStmt (CExpr (Just (C.CCall (CVar (C.Ident "__assert_fail" _ _) _) xs _)) _)) = do | ||
363 | x <- case xs of | ||
364 | (CConst (CStrConst msg _):_) -> let s = getCString msg | ||
365 | in Just $ Computation Map.empty Map.empty (Lit () (HS.String () s s)) | ||
366 | _ -> Nothing | ||
367 | let k = uniqIdentifier "go" (compFree x `Map.union` compIntro x) | ||
368 | x' = fmap (\y -> App () (hsvar "error") y) x | ||
369 | return $ fmap (\y -> Lambda () [hspvar k] y) x' | ||
362 | grokStatement (CBlockStmt (CExpr (Just | 370 | grokStatement (CBlockStmt (CExpr (Just |
363 | (CAssign CAssignOp cvarnew | 371 | (CAssign CAssignOp cvarnew |
364 | (C.CCall cvarfun [] _) _)) _)) = do | 372 | (C.CCall cvarfun [] _) _)) _)) = do |