mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
use throwIO instead of throw in a few placed
This commit is contained in:
@@ -69,7 +69,7 @@ module PGF2 (-- * PGF
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Prelude hiding (fromEnum)
|
import Prelude hiding (fromEnum)
|
||||||
import Control.Exception(Exception,throwIO,throw)
|
import Control.Exception(Exception,throwIO)
|
||||||
import Control.Monad(forM_)
|
import Control.Monad(forM_)
|
||||||
import System.IO.Unsafe(unsafePerformIO,unsafeInterleaveIO)
|
import System.IO.Unsafe(unsafePerformIO,unsafeInterleaveIO)
|
||||||
import Text.PrettyPrint
|
import Text.PrettyPrint
|
||||||
@@ -227,7 +227,7 @@ checkExpr (PGF p _) (Expr c_expr _) (Type c_ty _) =
|
|||||||
gu_pool_free exprPl
|
gu_pool_free exprPl
|
||||||
if is_tyerr
|
if is_tyerr
|
||||||
then return (Left msg)
|
then return (Left msg)
|
||||||
else throw (PGFError msg)
|
else throwIO (PGFError msg)
|
||||||
|
|
||||||
-- | Tries to infer the type of an expression. Note that
|
-- | Tries to infer the type of an expression. Note that
|
||||||
-- even if the expression is type correct it is not always
|
-- even if the expression is type correct it is not always
|
||||||
@@ -253,7 +253,7 @@ inferExpr (PGF p _) (Expr c_expr _) =
|
|||||||
gu_pool_free exprPl
|
gu_pool_free exprPl
|
||||||
if is_tyerr
|
if is_tyerr
|
||||||
then return (Left msg)
|
then return (Left msg)
|
||||||
else throw (PGFError msg)
|
else throwIO (PGFError msg)
|
||||||
|
|
||||||
-- | Check whether a type is consistent with the abstract
|
-- | Check whether a type is consistent with the abstract
|
||||||
-- syntax of the grammar.
|
-- syntax of the grammar.
|
||||||
@@ -277,7 +277,7 @@ checkType (PGF p _) (Type c_ty _) =
|
|||||||
gu_pool_free typePl
|
gu_pool_free typePl
|
||||||
if is_tyerr
|
if is_tyerr
|
||||||
then return (Left msg)
|
then return (Left msg)
|
||||||
else throw (PGFError msg)
|
else throwIO (PGFError msg)
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- Graphviz
|
-- Graphviz
|
||||||
|
|||||||
Reference in New Issue
Block a user