Changeset 5667
- Timestamp:
- 07/18/05 17:53:32 (3 years ago)
- svk:copy_cache_prev:
- 7648
- Files:
-
- 4 modified
-
perl5/PIL2JS/jspugs.pl (modified) (1 diff)
-
perl5/PIL2JS/lib/PIL/Nodes.pm (modified) (2 diffs)
-
perl5/PIL2JS/lib/PIL/Parser.pm (modified) (1 diff)
-
src/Pugs/Compile.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
perl5/PIL2JS/jspugs.pl
r5664 r5667 40 40 41 41 while(defined($_ = $term->readline($prompt))) { 42 $term->addhistory($_) if /\S/; 42 next unless /\S/; 43 $term->addhistory($_); 43 44 s/\s*$//; 44 45 -
perl5/PIL2JS/lib/PIL/Nodes.pm
r5665 r5667 151 151 sub as_js { 152 152 my $self = shift; 153 154 153 die unless @$self == 0; 155 return ""; 154 155 return "" unless $IN_SUBLIKE; 156 return "return(new PIL2JS.Box.Constant(undefined));"; 156 157 } 157 158 } … … 338 339 die if ref $self->[0]; 339 340 return sprintf "new PIL2JS.Box.Constant(%s)", PIL::Nodes::doublequote $self->[0]; 341 } 342 } 343 344 { 345 package PIL::VBool; 346 our @ISA = qw<PIL::PVal>; 347 348 sub as_js { 349 my $self = shift; 350 die unless @$self == 1; 351 352 return sprintf "new PIL2JS.Box.Constant(%s)", 353 $self->[0]->isa("PIL::True") ? "true" : 354 $self->[0]->isa("PIL::False") ? "false" : die; 340 355 } 341 356 } -
perl5/PIL2JS/lib/PIL/Parser.pm
r5644 r5667 184 184 185 185 VInt => 1, VRat => 1, 186 VStr => 1, VUndef => 0, 186 VStr => 1, VUndef => 0, VBool => 1, 187 187 SubPrim => 0, SubRoutine => 0, SubBlock => 0, SubPointy => 0, SubMethod => 0, 188 188 True => 0, False => 0, -
src/Pugs/Compile.hs
r5662 r5667 261 261 compile (Syn "loop" [pre, cond, post, (Syn "block" [body])]) = do 262 262 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' 264 270 bodyC <- compile body 265 271 postC <- compile post
