Changeset 14123 for src/Pugs/Eval.hs
- Timestamp:
- 10/09/06 17:26:38 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Eval.hs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Eval.hs
r14113 r14123 121 121 evalExp (Syn "=" [_Var "@*INIT", Syn "," []]) 122 122 -- The main runtime 123 resetT (evaluate exp) `finallyM` do123 tryT (evaluate exp) `finallyM` do 124 124 -- S04: END {...} at run time, ALAP 125 125 endAV <- reduceVar $ cast "@*END" … … 346 346 -- default to nonlocal exit 347 347 isNonLocal <- liftSTM $ newTVar True 348 val <- resetT $ do348 val <- tryT $ do 349 349 -- if the liftSTM is reached, exp evaluated without error; no need to shift out 350 350 evalExp exp `finallyM` liftSTM (writeTVar isNonLocal False) 351 351 mapM_ (\tmp -> evalExp $ App (Val tmp) Nothing []) tmps 352 352 isn <- liftSTM $ readTVar isNonLocal 353 (if isn then (shiftT . const) else id) (return val)353 (if isn then retShift else return) val 354 354 355 355 reducePad _ lex exp = do … … 942 942 retVal val 943 943 , "&return" ... \args -> do 944 op1Return . shiftT . const . fmap (VControl . ControlLeave (<= SubRoutine) 0) $944 (op1Return . retControl . ControlLeave (<= SubRoutine) 0) =<< 945 945 case args of 946 946 [] -> retEmpty … … 959 959 local callerEnv $ do 960 960 val <- apply sub Nothing args 961 shiftT $ const (retVal val)961 retShift =<< retVal val 962 962 retEmpty 963 963 , "&call" ... \inv args -> do
