Changeset 14353 for src/Pugs/Compile.hs

Show
Ignore:
Timestamp:
10/17/06 08:26:08 (2 years ago)
Author:
audreyt
svk:copy_cache_prev:
21206
Message:

* Pugs.Compile: Repair PIL1's handling of loops.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compile.hs

    r14337 r14353  
    221221    compile (Syn "loop" [exp]) = 
    222222        compile (Syn "loop" $ [emptyExp, Val (VBool True), emptyExp, exp]) 
    223     compile (Syn "loop" [pre, cond, post, (Syn "block" [body])]) = do 
     223    compile (Syn "loop" [pre, cond, post, body]) = do 
    224224        preC    <- compile pre 
    225225        -- loop (...; ; ...) {...} -> 
     
    234234        funC    <- compile (_Var "&statement_control:loop") 
    235235        return . PStmt . PExp $ PApp TCxtVoid funC Nothing 
    236             [preC, pBlock condC, pBlock bodyC, pBlock postC] 
     236            [preC, pBlock condC, bodyC, pBlock postC] 
    237237    compile exp@(Syn "unless" _) = fmap (PStmt . PExp) $ compConditional exp 
    238238    compile exp@(Syn "while" _) = compLoop exp 
     
    363363    bodyC   <- enter CxtVoid $ compile body 
    364364    funC    <- compile (_Var $ "&statement_control:" ++ name) 
    365     return . PStmt . PExp $ PApp cxt funC Nothing [pBlock condC, pBlock bodyC] 
     365    return . PStmt . PExp $ PApp cxt funC Nothing [pBlock condC, bodyC] 
    366366compLoop exp = compError exp 
    367367