about summary refs log tree commit diff
path: root/src/rustc/syntax
AgeCommit message (Collapse)AuthorLines
2012-03-29rustc: Move ext to librustsyntaxBrian Anderson-2786/+0
2012-03-29rustc: Remove the rustsyntax::attr wrapper in frontBrian Anderson-2/+2
2012-03-29rustc: Move attr, parse, print to rustsyntaxBrian Anderson-5370/+0
2012-03-29rustc: Move lexer and token to rustsyntaxBrian Anderson-948/+7
2012-03-29rustc: Move fold to rustsyntaxBrian Anderson-772/+0
2012-03-29rustc: Move interner to rustsyntaxBrian Anderson-39/+0
2012-03-29rustc: Move ast, ast_util, visit to rustsyntaxBrian Anderson-1604/+0
2012-03-29rustc: Move codemap to rustsyntaxBrian Anderson-204/+0
2012-03-29Require "self" as base expression for intra-class method or field referencesTim Chevalier-8/+1
All field or method references within a class must begin with "self." now. A bare reference to a field or method in the same class will no longer typecheck.
2012-03-28Allow explicit self-calls within classesTim Chevalier-103/+83
Allow writing self.f() within a class that has a method f. In a future commit, this syntax will be required. For now, you can write either self.f() or f(). I added a "privacy" field to all methods (whether class methods or not), which allowed me to refactor the AST somewhat (getting rid of the class_item type; now there's just class_member).
2012-03-28Allow references to "self" within classesTim Chevalier-1/+4
Allow writing self.f within a class that has a field f. Currently, the compiler accepts either self.f or f. In a future commit I'll require writing self.f and not f. Not sure whether self.f() works if f is a method (making sure that works next).
2012-03-27Enforce mutability declarations in classes; correct shapes for classesTim Chevalier-2/+2
1. Enforce mutability declarations on class fields. Don't allow any mutation of class fields not declared as mutable (except inside the constructor). 2. Handle classes correctly in shape (treat classes like records).
2012-03-27rust: Remove extensions' dependency on the sessionBrian Anderson-11/+8
2012-03-27Support returning from loop blocksMarijn Haverbeke-0/+3
The code is somewhat invasive, but it seems hard to do this in a clean way, since the design itself involves a bunch of 'action at a distance'. Issue #1819
2012-03-27Support an alternate for syntax that calls a higher-order functionMarijn Haverbeke-14/+50
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-26Bulk-edit mutable -> mut.Graydon Hoare-95/+95
2012-03-26rustc: Begin eliminating ext's dependency on the sessionBrian Anderson-37/+55
2012-03-26rustc: Move eval_const_expr to its own modBrian Anderson-166/+0
2012-03-26rustc: "unkown" -> "unknown"Patrick Walton-1/+1
2012-03-26Enforce privacy declarations for class fields and methodsTim Chevalier-4/+17
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-23rustc: Fix parsing of `ret &EXPR`Patrick Walton-0/+1
The parser didn't think that `&` could start an expression.
2012-03-23Remove last vestiges of old-style intrinsicsMarijn Haverbeke-1/+0
Closes #2048
2012-03-23Revert removal of intrinsicsMarijn Haverbeke-0/+1
Oops. We can't do this yet until the next snapshot.
2012-03-23Rename builtin back to intrinsicMarijn Haverbeke-1/+1
As per Graydon's request Issue #1981
2012-03-23Remove support for the old-style intrinsicsMarijn Haverbeke-1/+0
Closes #2042 Closes #1981
2012-03-23Implement built-in native modules as an alternative to intrinsicsMarijn Haverbeke-1/+6
Issue #1981
2012-03-22make --enforce-mut-vars always on, add mut annotations to remaining filesNiko Matsakis-0/+7
2012-03-21add mut decls to rustc and make them mandatoryNiko Matsakis-177/+183
2012-03-21methods workTim Chevalier-1/+3
Cross-crate method calls don't work yet. Added run-pass/class-method-cross-crate to test that, but it's xfailed References to fields within methods don't work yet. Added run-pass/class-methods to test that, but it's also xfailed
2012-03-20Implement an initial version of placement new.Niko Matsakis-1/+28
2012-03-20rustc: Fix a few more instances of node ID stomping, due to AST folding ↵Patrick Walton-3/+5
incorrectly passing stuff through unchanged
2012-03-20rustc: Make the quasiquote operator stop reusing nodes (and therefore stop ↵Patrick Walton-3/+4
reusing node IDs). Should fix issue #1947 for real.
2012-03-20Class methods WIPTim Chevalier-33/+49
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-20rustc: Be more careful about spans in 'unexpected token' errorsMarijn Haverbeke-9/+12
Closes #2017
2012-03-20Revert order of arguments to option::maybe and from_maybeMarijn Haverbeke-1/+1
Closes #2019
2012-03-19rustc: Stop generating the flag_none #fmt flag. Issue #1993Brian Anderson-7/+0
2012-03-16core: Store reexporting result and either. Closes #1997Brian Anderson-1/+2
2012-03-16Check kind bounds when calling methodsMarijn Haverbeke-2/+4
Closes #1915
2012-03-15switch over to using new serialize/deserialize codeNiko Matsakis-120/+118
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-15Make sure resource destructors are properly monomorphizedMarijn Haverbeke-2/+2
2012-03-14std: Rename the hashmap constructors to conform to new standardsBrian Anderson-12/+12
Instead of using the new_ prefix just name them after their type
2012-03-14fixup auto_serialize's treatment of nullary variantsNiko Matsakis-3/+10
2012-03-14fix auto_serialize for enums with type parametersNiko Matsakis-34/+186
2012-03-14Add crude support for casts in constant expressionsMarijn Haverbeke-21/+42
Only casts to integral and float types are supported Closes #1975
2012-03-14Properly walk pat_lit and pat_range in visit.rsMarijn Haverbeke-1/+3
Issue #1975
2012-03-14adjust auto_serialize to generate fns named serialize_T()Niko Matsakis-79/+64
We used to generate a module T with a serialize() and deserialize() fn, but this was suboptimal for a number of reasons: - it required moving serialization into core so that uint etc worked - it was harder to override the serialization behavior locally (this is now trivial)
2012-03-13implement deserialization, rename mk_mem_buffer() to mem_buffer()Niko Matsakis-146/+381
2012-03-13first (functional) version of the auto_serialize syntax extNiko Matsakis-106/+166