summary refs log tree commit diff
path: root/src/rustc/syntax/visit.rs
AgeCommit message (Collapse)AuthorLines
2012-03-27Support an alternate for syntax that calls a higher-order functionMarijn Haverbeke-5/+5
The last argument of the call must be a block, and the type of this argument must a function returning bool. `break` and `cont` are supported in the body of the block, and return `false` or `true` from the function. When the end of the function is reached, `true` is implicitly returned. for vec::all([1, 2, 3]) {|elt| if elt == 2 { break; } log(error, elt); } Issue #1619
2012-03-23Handle self correctly when translating classesTim Chevalier-4/+8
This change uses the same code for handling the "self" reference for classes as is already used for impls/ifaces. This allows removing the extra maybe_self_id argument (which was just for classes) to trans_closure that I added before. I also rewrote the translation for class ctors so that it doesn't generate new AST nodes (instead translating directly). Also changed visit so that it visits class ctors correctly with visit_fn, and changed typestate to not do return-checking when visiting a class ctor.
2012-03-20Implement an initial version of placement new.Niko Matsakis-0/+4
2012-03-20Class methods WIPTim Chevalier-2/+2
In particular, use the ast::method type to represent a class method, and try to reuse as much iface code as possible. (This makes sense now since I'll be allowing polymorphic class methods.)
2012-03-15Reuse monomorphized functions more aggressivelyMarijn Haverbeke-1/+1
Adds a trans::type_use pass that, given a function body, detects how dependant that function is on properties of its type parameters.
2012-03-14Properly walk pat_lit and pat_range in visit.rsMarijn Haverbeke-1/+3
Issue #1975
2012-03-09Add an infinite loop constructTim Chevalier-0/+1
Add a loop {} construct for infinite loops, and use it in test cases. See #1906 for details.
2012-03-08rustc: Change the address-of operator to an explicit production so that we ↵Patrick Walton-0/+1
can parse the mutability
2012-03-08rustc: Add ty_rptr support to the visitorPatrick Walton-0/+1
2012-03-08Explicitly store self_ids use for self locals in methodsMarijn Haverbeke-4/+4
This makes it possible to move them between crates without confusion, and to instantiate them at a point where the monomorphizing substitutions are known. Issue #1944
2012-03-04Translate simple classesTim Chevalier-3/+3
Programs using classes with fields only (no methods) compile and run, as long as nothing refers to a class in a different crate (todo). Also changed the AST representation of classes to have a separate record for constructor info (instead of inlining the fields in the item_class node), and fixed up spans and pretty-printing for classes.
2012-03-02Move src/comp to src/rustcGraydon Hoare-0/+546