mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-06 17:52:51 -06:00
the sd -size command now shows the size of all code needed for defining an oper
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user