Changeset 4394 for src/Pugs/Prim/Eval.hs
- Timestamp:
- 06/05/05 10:45:28 (4 years ago)
- svk:copy_cache_prev:
- 6052
- Files:
-
- 1 modified
-
src/Pugs/Prim/Eval.hs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Eval.hs
r4393 r4394 32 32 requireInc incs file (errMsg file incs) 33 33 where 34 style = MkEvalStyle{ evalError = EvalErrorFatal 35 , evalResult = (if dumpEnv == True then EvalResultEnv else EvalResultLastValue)} 34 style = MkEvalStyle 35 { evalError = EvalErrorFatal 36 , evalResult = (if dumpEnv == True then EvalResultEnv 37 else EvalResultLastValue)} 36 38 errMsg file incs = "Can't locate " ++ file ++ " in @INC (@INC contains: " ++ unwords incs ++ ")." 37 39 requireInc [] _ msg = fail msg … … 52 54 else do 53 55 contents <- liftIO $ readFile filename 54 opEval MkEvalStyle{ evalError=EvalErrorUndef, evalResult=EvalResultLastValue} filename $ decodeUTF8 contents 56 opEval style filename $ decodeUTF8 contents 57 where 58 style = MkEvalStyle{ evalError=EvalErrorUndef 59 , evalResult=EvalResultLastValue} 55 60 56 61 op1EvalHaskell :: Val -> Eval Val … … 58 63 str <- fromVal cv 59 64 val <- resetT $ evalHaskell str 60 retEvalResult MkEvalStyle{ evalError=EvalErrorUndef, evalResult=EvalResultLastValue} val 65 retEvalResult style val 66 where 67 style = MkEvalStyle{ evalError=EvalErrorUndef 68 , evalResult=EvalResultLastValue} 61 69 62 70 opEval :: EvalStyle -> FilePath -> String -> Eval Val … … 80 88 writeRef errSV (VStr str) 81 89 when (evalError style == EvalErrorFatal) $ do 82 --trace ("fatal error" ++ str) $ return ()83 --FIXME: this should be made to throw an exception.84 90 liftIO $ fail $ pretty err 85 91 retEmpty
