Changeset 5667 for src/Pugs/Compile.hs

Show
Ignore:
Timestamp:
07/18/05 17:53:32 (3 years ago)
Author:
iblech
svk:copy_cache_prev:
7648
Message:

* Pugs.Compile -- loop foo; ; bar {baz} should be compiled as loop foo;

bool::true; bar {baz}.

* PIL2JS: jspugs.pl -- Empty lines don't cause a compile now.
* PIL2JS: PIL::Nodes, PIL::Parser -- Support for VBool.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compile.hs

    r5662 r5667  
    261261    compile (Syn "loop" [pre, cond, post, (Syn "block" [body])]) = do 
    262262        preC    <- compile pre 
    263         condC   <- compile cond 
     263        -- loop ...; ; ... {...} -> 
     264        -- loop ...; bool::true; ... {...} 
     265        let cond' | unwrap cond == Noop 
     266                  = return $ PStmts (PStmt . PLit . PVal $ VBool True) PNil 
     267                  | otherwise 
     268                  = compile cond 
     269        condC   <- cond' 
    264270        bodyC   <- compile body 
    265271        postC   <- compile post