mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-04 16:52:50 -06:00
added exprSize in the Haskell binding
This commit is contained in:
@@ -39,7 +39,7 @@ module PGF2 (-- * PGF
|
||||
mkFloat,unFloat,
|
||||
mkMeta,unMeta,
|
||||
mkCId,
|
||||
exprHash,
|
||||
exprHash, exprSize,
|
||||
treeProbability,
|
||||
|
||||
-- ** Types
|
||||
@@ -331,7 +331,13 @@ exprHash h (Expr c_expr touch1) =
|
||||
touch1
|
||||
return (fromIntegral h)
|
||||
|
||||
|
||||
exprSize :: Expr -> Int32
|
||||
exprSize (Expr c_expr touch1) =
|
||||
unsafePerformIO $ do
|
||||
size <- pgf_expr_size c_expr
|
||||
touch1
|
||||
return (fromIntegral size)
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Graphviz
|
||||
|
||||
Reference in New Issue
Block a user