Tim Chevalier
17ff2a0d79
Further support for predicate constraints
...
Changed function types to include a list of constraints. Added
code for parsing and pretty-printing constraints. This necessitated
splitting pprust into two files (pprust and ppaux) to break a
circulate dependency, as ty_to_str now needs to print out constraints,
which may include literals, but pprust depended on ty.
2011-06-09 11:37:52 -07:00
Rafael Ávila de Espíndola
429e21414b
Parse pointers in metadata.
2011-06-03 15:13:10 -04:00
Eric Holk
84a56ed7cd
Teach the compiler to understand yield and join, as well as using task as a type name.
2011-05-31 16:28:13 -07:00
Brian Anderson
81fc2d8728
rustc: Remove unneeded type params from alt patterns
2011-05-31 01:23:53 -04:00
Graydon Hoare
2561b01211
Remove residual uses of fold, and fold itself.
2011-05-26 17:16:54 -07:00
Tim Chevalier
a08a376d6e
Make controlflow part of a function type
...
Change ty_fn to have a controlflow field. A 'controlflow' is
essentially a bit of data that says whether or not this function
never returns to the caller (if it never returns, that means it calls
"fail" or another "never-returns" function on every control path).
Also add syntax for annotating functions that never return:
fn foo() -> ! {
fail;
}
for example. Functions marked with ! implicitly have a result type of
ty_bot, which is a new type that this commit also adds.
2011-05-20 16:57:37 -07:00
Graydon Hoare
7f938f4945
Move the ty_item_table into ty::ctxt.items, move variant_info to ty, and start sketching the contains_pointer property on types.
2011-05-19 17:21:36 -07:00
Marijn Haverbeke
09d8ef8d51
Finally rename std::_xxx to std::xxx
...
Except for _task, which is still a keyword.
2011-05-17 20:41:41 +02:00
Graydon Hoare
fbbc1a77d2
Rewrite everything to use [] instead of vec() in value position.
2011-05-16 18:21:22 -07:00
Marijn Haverbeke
eb419fd8c7
Extend crate format to allow multiple definitions for a single name
...
The type/value namespace distinction pretty much works now. Module
namespace is up next.
2011-05-13 17:20:39 +02:00
Marijn Haverbeke
3816e57fd2
Downcase std modules again, move to :: for module dereferencing
...
This should be a snapshot transition.
2011-05-12 21:30:44 +02:00
Marijn Haverbeke
6510f1ce7c
Change module dereference syntax from . to ::
...
This will need to be a snapshot.
2011-05-12 21:30:35 +02:00
Marijn Haverbeke
e9c12ab1d0
Rewrite comp/middle/resolve.rs
...
* Cleans up the algorithm
* Move first pass to walk (second still folds)
* Support part of a type/value namespace split
(crate metadata and module indices still need to be taught about this)
* Remove a few blatant inefficiencies (import tables being recreated for
every lookup, most importantly)
2011-05-11 12:32:37 +02:00
Graydon Hoare
4539f8a03c
Alias-ify fold and its users, remove another 85kb.
2011-05-09 17:50:06 -07:00
Patrick Walton
662e949540
rustc: Alias fix part 1 -- Separate out AST modes from typechecker modes, and introduce an "either value or alias" mode
2011-05-09 12:27:03 -07:00
Marijn Haverbeke
a3ec0b1f64
Rename std modules to be camelcased
...
(Have fun mergining your stuff with this.)
2011-05-06 22:51:19 +02:00
Patrick Walton
2d9ccf3ae5
rustc: Add Rust intrinsic support to the crate metadata reader and writer
2011-05-05 14:35:18 -07:00
Graydon Hoare
cdb6822405
Add a structure for passing option flags around the compiler, put it in session, and use it.
2011-05-04 16:59:21 -07:00
Patrick Walton
147a2d655f
Un-revert "Use different syntax for checks that matter to typestate", fixing the problem.
...
This reverts commit d08b443fff
.
2011-05-02 17:50:46 -07:00
Graydon Hoare
d08b443fff
Revert "Use different syntax for checks that matter to typestate"
...
This reverts commit aa25f22f19
. It broke stage2, not sure why yet.
2011-05-02 17:35:33 -07:00
Tim Chevalier
aa25f22f19
Use different syntax for checks that matter to typestate
...
This giant commit changes the syntax of Rust to use "assert" for
"check" expressions that didn't mean anything to the typestate
system, and continue using "check" for checks that are used as
part of typestate checking.
Most of the changes are just replacing "check" with "assert" in test
cases and rustc.
2011-05-02 12:16:29 -07:00
Graydon Hoare
a2f68b2d58
Intern metadata while writing, shrink stage1 from 12mb to 5.7mb.
2011-04-29 15:26:28 +00:00
Patrick Walton
e102413aad
rustc: Pass a "type context" around instead of directly passing the type store; prep for removing type annotations
2011-04-25 12:15:55 -07:00
Patrick Walton
e0eccaddb2
rustc: Thread the type store through everything that needs to access type structures
2011-04-22 17:00:46 -07:00
Patrick Walton
c7473c8260
rustc: Switch @ty.t to ty.t so that we can change it to a uint
2011-04-22 12:27:52 -07:00
Patrick Walton
c1335510d5
rustc: Eliminate the direct use of ty.t.struct
2011-04-22 12:09:09 -07:00
Patrick Walton
5dbf554bb3
rustc: Pass a type store around, which does nothing yet
2011-04-21 14:30:27 -07:00
Patrick Walton
cac7524c1a
rustc: Remove all manual type construction outside ty.rs
2011-04-20 11:59:10 -07:00
Graydon Hoare
d2bd07dcb0
Remove effect system from src.
2011-04-19 13:35:49 -07:00
Marijn Haverbeke
6511d471ba
replace error logging with log_err in stdlib and rustc
2011-04-19 16:57:13 +02:00
Marijn Haverbeke
0bf75a203e
collect crate meta info and ext crate names
2011-04-18 15:28:47 +02:00
Patrick Walton
de0175abed
rustc: Switch to indices for type parameters
2011-04-12 15:10:40 -07:00
Marijn Haverbeke
39774e88b4
Add a very basic crate-dump utility
...
'rustc -ls [cratelib]' will now dump out a list of symbols defined by
the crate, as well as a short description of what they are.
2011-04-07 14:19:19 -07:00
Marijn Haverbeke
ac3026412b
Revise EBML reader API
...
New one is less stateful, easier to work with.
2011-04-07 14:19:16 -07:00
Graydon Hoare
0397c05f42
Support for passing native types through metadata/creader.
2011-04-01 17:04:51 -07:00
Patrick Walton
6dc452335a
rustc: Get tag variants from the crate metadata
2011-04-01 13:02:44 -07:00
Patrick Walton
bdea343879
rustc: Use the path index. Speeds up compilation a lot.
2011-03-31 18:28:59 -07:00
Patrick Walton
fffc5d3b3d
rustc: Write out a path index as well
2011-03-31 18:28:59 -07:00
Graydon Hoare
1b65a61cad
Couple minor bug fixes in creader, lib-bitv, int, rand, sort, sha1, uint and vec all work.
2011-03-31 15:57:36 -07:00
Patrick Walton
3c1de96cda
rustc: Use the crate index to look up defs
2011-03-31 14:37:44 -07:00
Patrick Walton
3945ace520
rustc: Write out an index of definition info in crate metadata
2011-03-31 11:56:02 -07:00
Patrick Walton
ab8d200fb0
rustc: Read 'y' tags from external crates
2011-03-30 18:28:33 -07:00
Patrick Walton
cc59cea8b0
rustc: Thread an item-to-type mapping throughout the typechecking and translation phases
2011-03-30 17:28:06 -07:00
Patrick Walton
626bdaaa1f
rustc: Parse parameter IDs in external crate metadata. Un-XFAIL lib-bitv.rs.
2011-03-29 17:25:55 -07:00
Patrick Walton
c67eb1a575
rustc: Partially resolve external module imports
2011-03-29 17:01:27 -07:00
Patrick Walton
6a5feffd6c
rustc: Tolerate def id tags inside module tags. Fixes metadata reading.
2011-03-29 16:43:27 -07:00
Patrick Walton
94c061729b
rustc: Resolve external modules and native modules to definition IDs as well
2011-03-29 14:46:42 -07:00
Graydon Hoare
734abe593d
Teach trans to emit undefined references to 'use'd symbols. Can compile and run a simple 'use std;' example now.
2011-03-29 13:23:51 -07:00
Patrick Walton
2809e30d1d
rustc: Parse types in external metadata
2011-03-28 16:49:26 -07:00
Patrick Walton
ace2c92a96
rustc: Populate the item types table with types of items from external crates; remove the redundant typeck.ty_and_params type on the way
2011-03-28 14:42:01 -07:00