forked from GitHub/gf-core
refactoring
This commit is contained in:
@@ -702,14 +702,14 @@ parse c ty sent =
|
||||
return (ParseOk exprs)
|
||||
|
||||
enumerateExprs c_db c_enum_ptr = do
|
||||
c_enum <- newForeignPtrEnv pgf_free_expr_enum unmarshaller c_enum_ptr
|
||||
c_enum <- newForeignPtr pgf_free_expr_enum c_enum_ptr
|
||||
c_fetch <- (#peek PgfExprEnumVtbl, fetch) =<< (#peek PgfExprEnum, vtbl) c_enum_ptr
|
||||
unsafeInterleaveIO (fetchLazy c_fetch c_enum)
|
||||
where
|
||||
fetchLazy c_fetch c_enum =
|
||||
withForeignPtr c_enum $ \c_enum_ptr ->
|
||||
alloca $ \p_prob -> do
|
||||
c_expr <- callFetch c_fetch c_enum_ptr c_db unmarshaller p_prob
|
||||
c_expr <- callFetch c_fetch c_enum_ptr c_db p_prob
|
||||
if c_expr == castPtrToStablePtr nullPtr
|
||||
then do return []
|
||||
else do expr <- deRefStablePtr c_expr
|
||||
|
||||
@@ -269,9 +269,9 @@ foreign import ccall pgf_align_words :: Ptr PgfDB -> Ptr Concr -> StablePtr Expr
|
||||
|
||||
foreign import ccall pgf_parse :: Ptr PgfDB -> Ptr Concr -> StablePtr Type -> Ptr PgfMarshaller -> Ptr PgfText -> Ptr PgfExn -> IO (Ptr PgfExprEnum)
|
||||
|
||||
foreign import ccall "dynamic" callFetch :: Dynamic (Ptr PgfExprEnum -> Ptr PgfDB -> Ptr PgfUnmarshaller -> Ptr (#type prob_t) -> IO (StablePtr Expr))
|
||||
foreign import ccall "dynamic" callFetch :: Dynamic (Ptr PgfExprEnum -> Ptr PgfDB -> Ptr (#type prob_t) -> IO (StablePtr Expr))
|
||||
|
||||
foreign import ccall "&pgf_free_expr_enum" pgf_free_expr_enum :: FunPtr (Ptr PgfUnmarshaller -> Ptr PgfExprEnum -> IO ())
|
||||
foreign import ccall "&pgf_free_expr_enum" pgf_free_expr_enum :: FunPtr (Ptr PgfExprEnum -> IO ())
|
||||
|
||||
foreign import ccall "wrapper" wrapSymbol0 :: Wrapper (Ptr PgfLinearizationOutputIface -> IO ())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user