Commit graph

329 commits

Author SHA1 Message Date
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
Brian Anderson
bba245f3e6 Add support for bool, char to extfmt.
XFAIL syntax-extension-fmt in rustboot.
2011-04-11 21:54:03 -04:00
Brian Anderson
37f87161cc Move ExtFmt compile-time functions into their own module 2011-04-11 21:51:23 -04:00
Brian Anderson
ce85b9eb7b Make ExtFmt call its own functions instead of others defined in std 2011-04-11 21:51:23 -04:00
Brian Anderson
d4d0144bcf Move extfmt parsing into standard library 2011-04-11 21:51:23 -04:00
Brian Anderson
5a36786634 Move the extfmt data model into the standard library. 2011-04-11 21:51:23 -04:00
Marijn Haverbeke
c0d0b717ee Fix codemap.lookup_pos
Previously, it would place every single location in the first
file of the crate that was parsed.
2011-04-09 01:57:48 +02:00
Marijn Haverbeke
1af3174fe3 Move to single-uint file-position representation.
This makes passing them around cheaper. There is now a table (see
front/codemap.rs) that is needed to transform such an uint into an
actual filename/line/col location.

Also cleans up the span building in the parser a bit.
2011-04-09 01:05:18 +02:00
Marijn Haverbeke
094d31f5e4 Make lexer buffer the whole file
This way, it won't have to go through a bunch of calls for each
byte fetched.
2011-04-09 01:05:18 +02:00
Lindsey Kuper
1092bbfff0 Support for self-calls that take arguments.
Nicer parsing of self-calls (expr_self_method nodes inside expr_call
nodes, rather than a separate expr_call_self) makes typechecking
tractable.  We can now write self-calls that take arguments and return
values (see: test/run-pass/obj-self-*.rs).
2011-04-07 14:26:34 -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