diff options
| author | jordi.saludes <jordi.saludes@upc.edu> | 2010-07-27 07:50:48 +0000 |
|---|---|---|
| committer | jordi.saludes <jordi.saludes@upc.edu> | 2010-07-27 07:50:48 +0000 |
| commit | b9de5c36c0a62048abee457d89b994ebbeb7acf7 (patch) | |
| tree | 6b07136d3404bf665f6632b6e49fd864c0ed21c9 /contrib/py-bindings/PyGF.hsc | |
| parent | 1209cd8f9e83dd7824980f3f6ec5c94588a63bb2 (diff) | |
Added inferExpr to py-bindings.
Diffstat (limited to 'contrib/py-bindings/PyGF.hsc')
| -rw-r--r-- | contrib/py-bindings/PyGF.hsc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/py-bindings/PyGF.hsc b/contrib/py-bindings/PyGF.hsc index 6ac5b05d7..7b9991f3e 100644 --- a/contrib/py-bindings/PyGF.hsc +++ b/contrib/py-bindings/PyGF.hsc @@ -219,6 +219,13 @@ gf_unstr pexp = do Just s -> newCString s _ -> return nullPtr +foreign export ccall gf_inferexpr :: Ptr PGF -> Ptr Expr -> Ptr Type -> IO () +gf_inferexpr ppgf pexp ptype = do + pgf <- peek ppgf + exp <- peek pexp + let Right (_,t) = inferExpr pgf exp + poke ptype t + foreign import ccall "newLang" pyLang :: IO (Ptr Language) foreign import ccall "newTree" pyTree :: IO (Ptr Tree) foreign import ccall "newCId" pyCId :: IO (Ptr CId) |
