Changeset 8705 for src/Pugs/Eval.hs

Show
Ignore:
Timestamp:
01/16/06 18:57:28 (3 years ago)
Author:
audreyt
Message:

* Support for $+var as shorthand for $CALLER::var.
* CALLER now only sees lexical variables in the outer dynamic

scope declared with the "env" scope specifier.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval.hs

    r8699 r8705  
    6464        { envContext = CxtVoid 
    6565        , envLexical = mkPad [] 
     66        , envImplicit= Map.empty 
    6667        , envLValue  = False 
    6768        , envGlobal  = glob 
     
    309310 
    310311reducePad :: Scope -> Pad -> Exp -> Eval Val 
     312reducePad SEnv lex@(MkPad lex') exp = do 
     313    local (\e -> e{ envImplicit = Map.map (const ()) lex' `Map.union` envImplicit e }) $ 
     314        reducePad SMy lex exp 
    311315reducePad SMy lex exp = do 
    312316    -- heuristics: if we are repeating ourselves, generate a new TVar. 
     
    987991        } 
    988992    fixEnv :: Env -> Env 
    989     fixEnv env 
    990         | typ >= SubBlock = env 
    991         | otherwise       = env 
    992             { envCaller = Just env 
    993             , envDepth = envDepth env + 1 } 
     993    fixEnv | typ >= SubBlock = id 
     994           | otherwise       = envEnterCaller 
    994995    doBind :: [PadMutator] -> [(Param, Exp)] -> Eval ([PadMutator], [ApplyArg]) 
    995996    doBind syms [] = return (syms, [])