Changeset 14123 for src/Pugs/Eval.hs

Show
Ignore:
Timestamp:
10/09/06 17:26:38 (2 years ago)
Author:
audreyt
Message:

* Pugs.Eval: Finish excising of resetT and shiftT and replace

them with tryT and retControl.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval.hs

    r14113 r14123  
    121121    evalExp (Syn "=" [_Var "@*INIT", Syn "," []]) 
    122122    -- The main runtime 
    123     resetT (evaluate exp) `finallyM` do 
     123    tryT (evaluate exp) `finallyM` do 
    124124        -- S04: END {...}       at run time, ALAP 
    125125        endAV       <- reduceVar $ cast "@*END" 
     
    346346    -- default to nonlocal exit 
    347347    isNonLocal  <- liftSTM $ newTVar True 
    348     val <- resetT $ do 
     348    val <- tryT $ do 
    349349        -- if the liftSTM is reached, exp evaluated without error; no need to shift out 
    350350        evalExp exp `finallyM` liftSTM (writeTVar isNonLocal False) 
    351351    mapM_ (\tmp -> evalExp $ App (Val tmp) Nothing []) tmps 
    352352    isn <- liftSTM $ readTVar isNonLocal 
    353     (if isn then (shiftT . const) else id) (return val) 
     353    (if isn then retShift else return) val 
    354354 
    355355reducePad _ lex exp = do 
     
    942942        retVal val 
    943943    , "&return"     ... \args -> do 
    944         op1Return . shiftT . const . fmap (VControl . ControlLeave (<= SubRoutine) 0) $  
     944        (op1Return . retControl . ControlLeave (<= SubRoutine) 0) =<< 
    945945            case args of 
    946946                []      -> retEmpty 
     
    959959        local callerEnv $ do 
    960960            val <- apply sub Nothing args 
    961             shiftT $ const (retVal val) 
     961            retShift =<< retVal val 
    962962            retEmpty 
    963963    , "&call"       ... \inv args -> do