Show
Ignore:
Timestamp:
06/21/05 16:35:44 (4 years ago)
Author:
iblech
svk:copy_cache_prev:
6641
Message:

Pugs.Compile.PIR -- Trivial one word patch: s/unless_null/if_null/, now macros work:

pugs -CPIR -we 'macro zz ($a) { warn "[$a]"; return { 42 } } say zz(5)'

This says "[5]" at compile-time and outputs "42" at run-time. Macros which
return strings work too.

Files:
1 modified

Legend:

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

    r4891 r4903  
    589589    when (isOptional prm) $ do 
    590590        [defC] <- genLabel ["defaultDone"] 
    591         tellIns $ "unless_null" .- [bare name, bare defC] 
     591        tellIns $ "if_null" .- [bare name, bare defC] 
    592592        case tpDefault param of 
    593593            Nothing     -> tellIns $ InsNew (VAR name) PerlScalar