From af1a581f40a8a1fb7da66eb69fc43280650f1042 Mon Sep 17 00:00:00 2001 From: krasimir Date: Thu, 26 Jan 2017 14:09:07 +0000 Subject: type checking API in the Haskell binding --- src/runtime/haskell-bind/PGF2/FFI.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/runtime/haskell-bind/PGF2/FFI.hs') diff --git a/src/runtime/haskell-bind/PGF2/FFI.hs b/src/runtime/haskell-bind/PGF2/FFI.hs index 949c46471..5ae2ced06 100644 --- a/src/runtime/haskell-bind/PGF2/FFI.hs +++ b/src/runtime/haskell-bind/PGF2/FFI.hs @@ -61,6 +61,8 @@ gu_exn_type_PgfExn = Ptr "PgfExn"# :: CString gu_exn_type_PgfParseError = Ptr "PgfParseError"# :: CString +gu_exn_type_PgfTypeError = Ptr "PgfTypeError"# :: CString + foreign import ccall "gu/string.h gu_string_in" gu_string_in :: CString -> Ptr GuPool -> IO (Ptr GuIn) @@ -290,6 +292,16 @@ foreign import ccall "pgf/pgf.h pgf_expr_unlit" foreign import ccall "pgf/expr.h pgf_expr_arity" pgf_expr_arity :: PgfExpr -> IO CInt +foreign import ccall "pgf/expr.h pgf_check_expr" + pgf_check_expr :: Ptr PgfPGF -> Ptr PgfExpr -> PgfType -> Ptr GuExn -> Ptr GuPool -> IO () + +foreign import ccall "pgf/expr.h pgf_infer_expr" + pgf_infer_expr :: Ptr PgfPGF -> Ptr PgfExpr -> Ptr GuExn -> Ptr GuPool -> IO PgfType + +foreign import ccall "pgf/expr.h pgf_check_type" + pgf_check_type :: Ptr PgfPGF -> Ptr PgfType -> Ptr GuExn -> Ptr GuPool -> IO () + + foreign import ccall "pgf/expr.h pgf_print_expr" pgf_print_expr :: PgfExpr -> Ptr PgfPrintContext -> CInt -> Ptr GuOut -> Ptr GuExn -> IO () -- cgit v1.2.3