Commit graph

340 commits

Author SHA1 Message Date
Graydon Hoare
b00f3074d4 Remove boxes from token.t. 2011-05-09 14:17:45 -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
Graydon Hoare
0f23bbac01 Fix GenericOS.getenv returning a raw str, return an Option.t[str] instead. 2011-05-06 16:30:39 -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
Tim Chevalier
e3a68e235c Bring back "pred" syntax for writing predicates for check
This commit reinstates the requirement that the predicate in a
"check" must be a manifest call to a special kind of function
declared with the new "pred" keyword instead of "fn". Preds must
have a boolean return type and can only call other preds; they
can't have any effects (as enforced by the typechecker).
The arguments to a predicate in a check expression must be
slot variables or literals.
2011-05-05 11:26:07 -07:00
Tim Chevalier
3060eadcba Check well-formedness of constraints
Check that the operand in a constraint is an explicit name,
and that the operands are all local variables or literals. Still need
to check that the name refers to a pure function.
2011-05-05 11:26:07 -07:00
Marijn Haverbeke
1f45dda9d2 Remove 'deprecated mutable...' from our code
This should make compilation a bit less noisy.
2011-05-05 20:19:43 +02:00
Graydon Hoare
d55fa2a9a3 Add #env syntax extension for plucking strings out of the compilation environment. 2011-05-04 19:05:32 -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
ac8eb20224 rustc: Stub support for Rust intrinsics 2011-05-03 18:03:59 -07:00
Patrick Walton
2bc17adc29 Revert "Rename the "llvm" API to "llvm-intrinsic"" due to tinderbox bustage
This reverts commit 6871c245a6.
2011-05-03 17:50:37 -07:00
Graydon Hoare
b453c3c728 Start sketching --depend support in rustc. 2011-05-03 15:56:00 -07:00
Patrick Walton
6871c245a6 Rename the "llvm" API to "llvm-intrinsic" 2011-05-03 15:55:01 -07:00
Brian Anderson
ed40c85af5 Extract ast.is_exported from the resolve module 2011-05-02 22:07:36 -04: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
Brian Anderson
2e12fbfc06 Support octal #fmt conversions 2011-04-26 20:20:17 -04: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
Marijn Haverbeke
2361b65526 Switch to binary search in codemap.lookup_pos
Patrick observed excessive slowness when looking up positions
in rustc. This might help.
2011-04-22 12:11:00 +02:00
Brian Anderson
540344acb9 Fix the signature of expr_ext
The extension body is just a string, not an expression.
2011-04-21 20:42:26 -04:00
Patrick Walton
5dbf554bb3 rustc: Pass a type store around, which does nothing yet 2011-04-21 14:30:27 -07:00
Patrick Walton
3dbfc9310a rustc: Make the parser never assign any types, not even ty_nil 2011-04-21 13:00:06 -07:00
Patrick Walton
cac7524c1a rustc: Remove all manual type construction outside ty.rs 2011-04-20 11:59:10 -07:00
Graydon Hoare
3d9cf15d0b Remove half-baked 'opacity' layer qualifier. 2011-04-19 14:00:04 -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
6d3a423094 add log_err to rustc 2011-04-19 16:57:13 +02:00
Brian Anderson
d4f1a48111 Support 0 flag in #fmt 2011-04-18 21:36:04 -04:00
Marijn Haverbeke
0bf75a203e collect crate meta info and ext crate names 2011-04-18 15:28:47 +02:00
Brian Anderson
9976bb93d6 Support the space flag in #fmt 2011-04-17 19:50:58 -04:00
Brian Anderson
86a43c24d6 Support + flag in #fmt 2011-04-17 18:19:26 -04:00
Brian Anderson
c7edcb3a72 Support #fmt precision for string types 2011-04-17 13:10:02 -04:00
Brian Anderson
96e3e29e88 Support left-justification in #fmt conversions 2011-04-16 19:43:29 -04:00
Brian Anderson
dcfdb02fab Make #fmt support explicit conversion widths 2011-04-16 18:01:17 -04:00
Graydon Hoare
232c450957 Work on destructors, not entirely functional yet (no tydesc integration). 2011-04-14 16:50:59 -07:00
Brian Anderson
99a697b56a Add support for upper-case hex and binary output to #fmt.
Only works for uints at present. Necessitated the addition of _str.to_upper.
2011-04-13 22:14:54 -04:00
Brian Anderson
5c0f4c1939 Add more commentary about ExtFmt 2011-04-13 22:14:40 -04:00
Brian Anderson
4844e1c08a Add support for printing uints as lower-case hex to ExtFmt.
Begin passing an ExtFmt.RT.conv parsed format description to each of the
ExtFmt.RT.conv* functions.
2011-04-13 22:14:24 -04:00
Brian Anderson
aebdef0cd6 Move #fmt conversion model into ExtFmt.CT namespace 2011-04-13 22:13:21 -04:00
Graydon Hoare
8e0ecb4d1a Lex numeric escapes, needed for lib-str.rs (which now passes). 2011-04-13 11:25:11 -07:00
Tim Chevalier
63e87c102d typestate_check can now handle expr_block, expr_if, and expr_binary
(caveat for the latter: it assumes that binary operations are strict;
a TODO is to detect or and and and correctly reflect that they're lazy
in the second argument). I had to add an ann field to ast.block,
resulting in the usual boilerplate changes.

Test cases that currently work (if you uncomment the typestate pass
in the driver) (all these are under test/compile-fail):

fru-typestate
ret-uninit
use-uninit
use-uninit-2
use-uninit-3
2011-04-12 19:03:52 -07:00
Patrick Walton
de0175abed rustc: Switch to indices for type parameters 2011-04-12 15:10:40 -07:00
Tim Chevalier
d7e8818414 Further work on typestate. Handles expr_rec and expr_assign now.
Also changed the ts_ann field on statements to be an ann instead,
which explains most of the changes.

As well, got rid of the "warning: no type for expression" error
by filling in annotations for local decls in typeck (not sure whether
this was my fault or not).

Finally, in bitv, added a clone() function to copy a bit vector,
and fixed is_true, is_false, and to_str to not be nonsense.
2011-04-12 14:31:46 -07:00
Brian Anderson
73eecbd0ca Factor out creation of calls into ExtFmt.RT 2011-04-11 21:55:03 -04:00