Changeset 4860 for src/Pugs/Compile

Show
Ignore:
Timestamp:
06/20/05 01:13:14 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
6641
Message:

* PIR - &foo.goto support. trivial, via tail calls.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compile/PIR.hs

    r4859 r4860  
    263263        compile $ App (Var "&Pugs::Internals::symbolic_deref") Nothing $ 
    264264            (Val . VStr $ sigil:""):exps 
     265    compile (App (Var "&goto") (Just inv) args) = do 
     266        cxt     <- askTCxt 
     267        funC    <- compile inv 
     268        argsC   <- enter cxtItemAny $ compile args 
     269        return $ PApp (TTailCall cxt) funC argsC 
    265270    compile (App fun (Just inv) args) = do 
    266271        compile (App fun Nothing (inv:args)) -- XXX WRONG 
     
    268273        cxt     <- askTCxt 
    269274        funC    <- compile fun 
    270         argsC   <- mapM (enter cxtItemAny . compile) args 
     275        argsC   <- enter cxtItemAny $ compile args 
    271276        return $ PApp cxt funC argsC 
    272277    compile exp@(Syn "if" _) = compConditional exp