summaryrefslogtreecommitdiff
path: root/src/compiler/GFI.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/GFI.hs')
-rw-r--r--src/compiler/GFI.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/compiler/GFI.hs b/src/compiler/GFI.hs
index 28f7b1dc2..7bb4df878 100644
--- a/src/compiler/GFI.hs
+++ b/src/compiler/GFI.hs
@@ -193,8 +193,15 @@ execute1 opts gfenv0 s0 =
let Right t = runP pExp (encodeUnicode utf8 (unwords ts))
err error return $ constantDepsTerm sgr t
_ -> error "give a term as argument"
- let printer = showTerm sgr TermPrintDefault Qualified
- putStrLn $ unwords $ map printer ops
+ let prTerm = showTerm sgr TermPrintDefault Qualified
+ let size = sizeConstant sgr
+ let printed
+ | elem "-size" os =
+ let sz = map size ops in
+ unlines $ ("total: " ++ show (sum sz)) :
+ [prTerm f ++ "\t" ++ show s | (f,s) <- zip ops sz]
+ | otherwise = unwords $ map prTerm ops
+ putStrLn $ printed
continue gfenv
show_operations ws =