From 1ed636f013cad12ab74f5fcd264280d7504ab951 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 16 Sep 2024 09:49:21 +0200 Subject: Some extra debug prints --- src/Ghci.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Ghci.hs') diff --git a/src/Ghci.hs b/src/Ghci.hs index 85081c5..d16d2a0 100644 --- a/src/Ghci.hs +++ b/src/Ghci.hs @@ -214,11 +214,11 @@ hGetUntil h mmax tag = do when (nread <= 0) $ exitEarly (BSB.toLazyByteString builder, ReachedEOF) bs <- lift $ BS.packCStringLen (ptr, nread) - -- lift $ putStrLn ("Read: " ++ show bs) + when debugPrints $ lift $ hPutStrLn stderr ("Read: " ++ show bs) when (or [BSS.toShort (BS.takeEnd suflen bs) == BSS.takeEnd suflen tag | n <- 0 : havePrefixes , let suflen = BSS.length tag - n]) $ do - -- lift $ putStrLn "yay determined end" + when debugPrints $ lift $ hPutStrLn stderr "yay determined end" exitEarly (BSB.toLazyByteString (builder <> BSB.byteString bs) ,ReachedTag) @@ -232,7 +232,7 @@ hGetUntil h mmax tag = do [n -- new matches | n <- [1 .. min (BS.length bs) (BSS.length tag)] , BSS.toShort (BS.takeEnd n bs) == BSS.take n tag] - -- lift $ putStrLn ("nextPrefixes = " ++ show nextPrefixes) + when debugPrints $ lift $ hPutStrLn stderr ("nextPrefixes = " ++ show nextPrefixes) loop (yet + nread) nextPrefixes (builder <> BSB.byteString bs) result <- execExitEarlyT (loop 0 [] mempty) when debugPrints $ hPutStrLn stderr ("Read: <" ++ show result ++ ">") -- cgit v1.2.3-70-g09d2