Changeset 5644 for src/Pugs/CodeGen
- Timestamp:
- 07/17/05 19:41:27 (3 years ago)
- Author:
- iblech
- svk:copy_cache_prev:
- 7648
- Message:
-
PIL -> JavaScript? compiler.
* Pugs.Compile: Modified the declaration of PApp to accept an invocant.
* Pugs.CodeGen?.PIR: Minor changes because of change #1, pugs -BPIR still passes
the sanity tests.
* New directory perl5/PIL2JS, containing various modules, a README, and
pil2js.pl:
$ pugs -CPIL -Ilib6 -MPrelude::JS -we 'say 2 + 3' | \
./pil2js.pl -html > /tmp/t.html
* t/01-sanity mostly pass! (see
* t/01-sanity/03-equal.t doesn't pass because of a bug in Pugs.Compile
("3
4" is compiled to "&infix:< >(3, 4)" instead of "&infix:< >(3, {4})"
or something similar.
* See perl5/PIL2JS/README for a list of things which already work.
- Files:
- 1 modified
-
src/Pugs/CodeGen/PIR.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/CodeGen/PIR.hs
r5413 r5644 108 108 tell [thisC] 109 109 trans rest 110 trans (PApp _ exp@(PCode _ _ _) []) = do110 trans (PApp _ exp@(PCode _ _ _) Nothing []) = do 111 111 blockC <- trans exp 112 112 tellIns $ [reg tempPMC] <-& blockC $ [] 113 113 return tempPMC 114 trans (PApp (TCxtLValue _) (PExp (PVar "&postcircumfix:[]")) [PExp lhs, rhs]) = do114 trans (PApp (TCxtLValue _) (PExp (PVar "&postcircumfix:[]")) Nothing [PExp lhs, rhs]) = do 115 115 lhsC <- trans lhs 116 116 rhsC <- trans rhs 117 117 return $ lhsC `KEYED` rhsC 118 trans (PApp _ fun args) = do 118 trans (PApp ctx fun (Just inv) args) = 119 trans (PApp ctx fun Nothing (inv:args)) -- XXX wrong 120 trans (PApp _ fun Nothing args) = do 119 121 funC <- trans fun {- case fun of 120 122 PExp (PVar name) -> return $ lit name
Download in other formats:
