Changeset 3443 for src/Pugs/Parser.hs

Show
Ignore:
Timestamp:
05/19/05 17:57:17 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
5016
Message:

* We have OUTER:: scope now.
* Closure (VCode) now captures over the entire Env, instead

of just the envLexical slot. This is currently only used to

restore the original OUTER
scope when calling a subroutine, but once we switch to oleg's CC_2CPST for Eval monad, this will get us rubyish coroutines (and serialised subcontinuations) for free.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Parser.hs

    r3437 r3443  
    331331            { isMulti       = isMulti 
    332332            , subName       = name' 
    333             , subPad        = envLexical env 
     333            , subEnv        = Just env 
    334334            , subType       = if isMethod then SubMethod else SubRoutine 
    335335            , subAssoc      = "pre" 
     
    439439                    { isMulti       = False 
    440440                    , subName       = name 
    441                     , subPad        = mkPad [] -- XXX really? 
     441                    , subEnv        = Nothing 
    442442                    , subReturns    = if null typ then typeOfSigil sigil else mkType typ 
    443443                    , subBody       = fun 
     
    761761    unless (isNothing formal || null names) $  
    762762        fail "Cannot mix placeholder variables with formal parameters" 
     763    env <- getState 
    763764    let sub = MkCode 
    764765            { isMulti       = False 
    765766            , subName       = "<anon>" 
    766             , subPad        = mkPad [] 
     767            , subEnv        = Just env 
    767768            , subType       = typ 
    768769            , subAssoc      = "pre"