Commit Graph

5779 Commits

Author SHA1 Message Date
David Rajchenbach-Teller
7bfe4dba80 [Test] rope.rs: testing concat 2011-11-06 18:10:23 +01:00
David Rajchenbach-Teller
bc1316aaf4 [Stdlib] rope.rs: concat, now attempts to preserve balance 2011-11-06 18:10:22 +01:00
David Rajchenbach-Teller
cefa97dc2e [Stdlib doc] char.rs: documented to_digit, cmp 2011-11-06 18:10:22 +01:00
David Rajchenbach-Teller
2dedcc8aa2 [stdlib optim] rope::node improved balancing strategy 2011-11-06 18:10:22 +01:00
Brian Anderson
7d741d69cb Add an LLVM git submodule 2011-11-05 13:23:10 -07:00
David Rajchenbach-Teller
1087f4b7b0 [Docfix] lib/str.rs: Applied review suggestions, took the opportunity to improve doc of my new functions. 2011-11-05 13:04:35 -07:00
David Rajchenbach-Teller
b17847b232 [Docfixes + feature] lib/uint.rs: Applied review suggesions, took the opportunity to add function loop 2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
57425b575c [Docfix + Renaming] lib/rope.rs: Applied review suggestions, mostly docfixes. 2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
f9a0d03c7a Fixup: forgotten stdtest/rope.rs 2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
a5dcf66ad3 stdlib: Added a small rope library 2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
07574363ef char.rs: Added a function cmp 2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
07ffe68ad9 uint.rs: added functions div_ceil, div_floor, div_round 2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
f4399063fc str.rs: Added functions loop_chars, loop_chars_sub, char_len_range, byte_len_range. 2011-11-05 13:04:34 -07:00
Elly Jones
b0278f5315 vec: take [mutable? T] instead of [T] 2011-11-04 17:30:03 -07:00
Marijn Haverbeke
5945667b99 Update some more tests for 1a68a9882 2011-11-03 11:14:48 +01:00
Marijn Haverbeke
1a68a98824 Disallow writing to function arguments again
Remove implicit copying hack.

Closes #1118
2011-11-03 10:57:54 +01:00
Matt Brubeck
5970e9c117 Add vec::permute to the standard library (#1013) 2011-11-02 15:35:10 -07:00
Niko Matsakis
b578ed9b2a add required symbols 2011-11-02 14:14:20 -07:00
Niko Matsakis
0982c7f78c hastily port so we don't fail to build 2011-11-02 14:14:20 -07:00
Niko Matsakis
8385d77b32 fix line too long 2011-11-02 14:14:20 -07:00
Niko Matsakis
ec77144713 add -m64 to gcc args if appropriate 2011-11-02 14:14:20 -07:00
Niko Matsakis
e012fd03f3 correct more i32 vs int mismatches 2011-11-02 14:14:19 -07:00
Niko Matsakis
602ae9139c convert various ints to i32 and vice versa 2011-11-02 14:14:19 -07:00
Niko Matsakis
4bd05e5be2 convert GEP to i32 2011-11-02 14:14:19 -07:00
Niko Matsakis
f1bc9307d8 get things checking on ia32 2011-11-02 14:14:19 -07:00
Niko Matsakis
c0e9c42bd2 thread the context through so that int can be 64 bits on x86_64 2011-11-02 14:14:19 -07:00
Niko Matsakis
2521cda1ec work on making the size of ints depend on the target arch 2011-11-02 14:14:19 -07:00
Niko Matsakis
9146bb09a1 work on making the size of ints depend on the target arch 2011-11-02 14:14:19 -07:00
Niko Matsakis
f05761ddb3 enable intrinsics for multiple arch 2011-11-02 14:13:22 -07:00
Niko Matsakis
20946e6970 start going back to an i386 build 2011-11-02 14:13:22 -07:00
Niko Matsakis
8011e3fabb hack around on makefiles trying to get a 64 bit build
right now there are many temporary hacks, search for NDM to find them
2011-11-02 14:13:22 -07:00
Niko Matsakis
020cd360e1 modify x64 assembly and so forth 2011-11-02 14:13:22 -07:00
Niko Matsakis
d3e865438f do not preserve caller-saved registers 2011-11-02 14:13:22 -07:00
Niko Matsakis
6a0d86c754 copy over x86-specific code 2011-11-02 14:13:22 -07:00
Niko Matsakis
5b3bddcd87 start to isolate target strings so that they can be configured for
x64 or other targets
2011-11-02 14:13:22 -07:00
Marijn Haverbeke
eef9a0bd39 Evaluate alt expressions in their own block context
Closes #785
2011-11-02 14:30:51 +01:00
Marijn Haverbeke
d8d35e7c40 Rename car/cdr to head/tail in std::list
Closes #1086
2011-11-02 14:23:49 +01:00
Marijn Haverbeke
5b0c103b39 Make it possible to cast unsafe pointers with the 'as' operator 2011-11-02 12:20:12 +01:00
Marijn Haverbeke
0a20eed2db Make ptr::addr_of return an immutable vec, add mut_addr_of 2011-11-02 12:20:12 +01:00
Marijn Haverbeke
eaf9e05611 Make 'lambda(...) -> ...' parse as a type 2011-11-02 12:20:11 +01:00
Marijn Haverbeke
4e9b8a28f7 Make resolving of imports behave more sanely
An import now ignores itself when resolving its target. This gets rid of
the previously existing (problematic) behaviour where the import would start
looking one scope up when its name was the same as its target's first
component.

Closes #1114
2011-11-02 12:20:11 +01:00
Marijn Haverbeke
7ed7e7fa79 Fix printing of parameterized tag types in ppaux
It was printing option::t[int] instead of option::t<int>
2011-11-02 12:20:11 +01:00
Brian Anderson
74e4b3b5c1 Register snapshots 2011-11-01 21:22:42 -07:00
Brian Anderson
4b01d11f92 Organize std.rc and make exports explicit 2011-11-01 20:48:44 -07:00
Brian Anderson
35affdfa61 Ignore another test involving failure on windows 2011-11-01 17:35:32 -07:00
Brian Anderson
eb8995e2fa Ignore should_fail tests on windows 2011-11-01 17:22:32 -07:00
Matt Brubeck
76077a9fb7 Add should_fail annotation for unit tests
This allows test cases to assert that a function is expected to fail.
Tests annotated with "should_fail" will succeed only if the function
fails.
2011-11-01 16:55:39 -07:00
Brian Anderson
61b604580b Fix alignment of interior pointers of dynamic-size types. Closes #1112
GEP_tup_like finds interior pointers by creating a tuple of all the types
preceding the element it wants a pointer to, then asks for the size of that
tuple. This results in incorrect pointers when the alignment of that tuple
is not the alignment of the interior type you're getting a pointer to.
2011-11-01 12:13:00 -07:00
Patrick Walton
587c118cac rt: Fix long lines 2011-10-31 15:50:15 -07:00
Patrick Walton
956812bda5 rt: Have __morestack conform to the calling convention that LLVM generates on x86 2011-10-31 15:41:19 -07:00
Brian Anderson
df12749b36 Register snapshots 2011-10-31 15:19:01 -07:00
Brian Anderson
bd33951b1c Update snapshot scripts for new stdlib name 2011-10-31 14:43:43 -07:00
Haitao Li
16dad84f7b rustc: Find crates by matching the name metadata 2011-10-31 14:43:43 -07:00
Patrick Walton
329f045d4c rustc: Enable segmented stacks in LLVM when --stack-growth is on 2011-10-31 14:42:44 -07:00
Patrick Walton
c9003d301f Stub a __morestack implementation and stack segment allocation. Untested. 2011-10-31 14:20:56 -07:00
Brian Anderson
8207506bbc Fix the filenames used in some IO tests
These tests are relying on not being able to open certain files, but did not
work correctly when run as root.
2011-10-31 12:50:45 -07:00
Matt Brubeck
80c926c5e2 Add a char::to_digit function 2011-10-31 16:15:36 +01:00
Matt Brubeck
4739942e74 Correct handling of non-numeric chars in parse_buf
Without this fix, int::parse_buf and uint::parse_buf return incorrect results
for any strings that contain non-numeric characters.  Fixes #1102.
2011-10-31 16:15:32 +01:00
Marijn Haverbeke
6f37accb29 Rename std::str::chars to iter_chars 2011-10-31 15:41:52 +01:00
Marijn Haverbeke
b0d60a7108 Add a way to iterate over a str's chars to std::str 2011-10-31 14:52:08 +01:00
Matt Brubeck
7080ac15fb Fix int::parse_buf for negative numbers (#1102) 2011-10-30 13:40:59 -07:00
Matt Brubeck
8c51d4b002 Make float::from_str ignore whitespace (#1089)
Discard leading and trailing whitespace, for consistency with C/JS/Java/etc.
Also, don't allow floating point numbers that start or end with 'e'.
2011-10-30 13:40:59 -07:00
Matt Brubeck
0bf10d84e2 Update keyword list in vim/syntax/rust.vim
Removed: iter, each, put, macro, meta, syntax, port, spawn
Added: block, copy
2011-10-29 20:50:17 -07:00
Brian Anderson
8befdd08a3 stdlib: Fix type in docs for result::chan 2011-10-29 20:16:44 -07:00
Brian Anderson
ce1be4d9a9 Cleanup the existing platform-specific ignored tests 2011-10-29 18:30:36 -07:00
Brian Anderson
f7ebe23ae1 Add the ability to ignore tests by compiler config
[test]
[ignore(cfg(target_os = "win32"))]
2011-10-29 18:30:32 -07:00
Brian Anderson
2e0593d999 stdlib: Add vec::concat to concatenate a vector of vectors
Compare to str::concat
2011-10-29 18:14:08 -07:00
Brian Anderson
da064ef884 Add more logging to crate resolution 2011-10-29 15:04:44 -07:00
Brian Anderson
e0f44730e8 rustc: Support 'companion mod's for crates and directory mods
Under this scheme when parsing foo.rc the parser will also look for
foo.rs to fill in the crate-level module, and when evaluating a
directory module directive it will look for a .rs file with the
same name as the directory.
2011-10-29 01:40:20 -07:00
Brian Anderson
2cebef095e stdlib: Make io failures recoverable by returning a result 2011-10-29 01:25:11 -07:00
Brian Anderson
2b62a80202 stdlib: Add result::chain for composing results 2011-10-29 01:25:11 -07:00
Brian Anderson
c1092fb6d8 stdlib: Add result module
This contains a result tag with ok(T) and error(U) variants. I expect
to use it for error handling on functions that can recover from errors,
like in the io module.
2011-10-29 01:25:06 -07:00
Brian Anderson
802deac323 stdlib: Add fs::splitext
Splits a path into the filename + extension
2011-10-28 23:34:01 -07:00
Brian Anderson
a2377ccf91 stdlib: Add vec::init. Returns all but the last element.
Per haskell, to go with head/tail, and last.
2011-10-28 22:42:38 -07:00
Matt Brubeck
b510a74a36 Cleanup: Remove uneccesary generic_cmp function. 2011-10-28 14:44:39 -07:00
Matt Brubeck
9c5c108d5b Add more isNaN tests 2011-10-28 14:44:39 -07:00
Matt Brubeck
45d7777991 Change behavior of float::nonpositive/nonnegative
Rather than being defined as !positive and !negative, these should act the
same as negative and positive (respectively).  The only effect of this change
should be that all four functions will now return false for NaN.
2011-10-28 14:44:39 -07:00
Matt Brubeck
000b2fe9a6 Use IEEE 754 semantics for NaN (Issue #1084) 2011-10-28 14:44:39 -07:00
Matt Brubeck
7e064deacf +0.0 should be positive and -0.0 should be negative. 2011-10-28 14:44:39 -07:00
Brian Anderson
54ddb553c2 stdlib: Replace an unsafe cast with ptr::null 2011-10-28 14:25:40 -07:00
Brian Anderson
f96ad30dfc stdlib: Make reinterpret_cast and leak unsafe 2011-10-28 14:19:17 -07:00
Brian Anderson
ad66d72e6c stdlib: Make merge_sort take [mutable? T] 2011-10-28 13:56:01 -07:00
Brian Anderson
39b729e36f stdlib: Fix the list::foldl implementation 2011-10-28 13:45:32 -07:00
Brian Anderson
49e8ffa34f stdlib: Rename list::length to list::len to match vec::len 2011-10-28 13:37:19 -07:00
Brian Anderson
2e8a8390d5 stdlib: Rename the 'ls_' param in list functions to 'ls' 2011-10-28 13:34:17 -07:00
Brian Anderson
1da99cdf68 stdlib: Make list::from_vec more efficient 2011-10-28 13:32:11 -07:00
Brian Anderson
d53a253dca stdlib: make list::from_vec take [mutable? T] 2011-10-28 13:24:39 -07:00
Brian Anderson
83219269d5 rustc: Remove broken --depend flag 2011-10-28 12:58:10 -07:00
Brian Anderson
2a2945e5de rustc: -h cleanup 2011-10-28 12:51:46 -07:00
Brian Anderson
d106a336cc rustc: Change --OptLevel to --opt-level 2011-10-28 12:49:19 -07:00
Brian Anderson
bab2b37fd0 rustc: Use consistent error handling in main 2011-10-28 11:57:01 -07:00
Brian Anderson
8da8a4a018 rustc: Extract error reporting from codemap 2011-10-28 11:43:07 -07:00
Brian Anderson
f2a3270b9c Reorder statements in rustc main to avoid bounds check 2011-10-28 11:17:07 -07:00
Haitao Li
a81fdf0a5a rustc: Lift output file name handling out of main 2011-10-28 11:12:10 -07:00
Haitao Li
7bb9a54c73 Produce dyn libraries with proper names
Issue #744
2011-10-28 11:05:43 -07:00
Marijn Haverbeke
7dacccde94 Make shared kind the default only for generic functions
You almost never want a function with pinned type params. For
types, objects, resources, and tags, pinned types are actually often
more sane. For most of these, shared rarely makes sense. Only tricky
case is objs -- you'll have to think about the kinds you want there.

Issue #1076
2011-10-28 17:00:14 +02:00
Marijn Haverbeke
6fe7aa4aff Move to blocks, rather than fn@s, in parser.rs 2011-10-28 16:41:56 +02:00
Marijn Haverbeke
7a0aee74bf Move to short type parameter keywords
Issue #1076
2011-10-28 15:25:33 +02:00
Marijn Haverbeke
8e65dffc30 Register snapshot 2011-10-28 15:25:29 +02:00
Marijn Haverbeke
3397fa4701 Move to short kind kinds words in test suite
Issue #1076
2011-10-28 14:57:49 +02:00
Marijn Haverbeke
cba4ddc6a4 Start accepting short keywords for parameter kinds
This is a pre-snapshot commit to be able to implement #1076 without
the bootstrap compiler getting in my way.
2011-10-28 14:57:35 +02:00
Brian Anderson
4bb5a2c43a Remove whitespace 2011-10-27 21:35:08 -07:00
Brian Anderson
d96c419b14 Add std::vec::foldr 2011-10-27 21:34:16 -07:00
Brian Anderson
8ad857f453 Add a test for std::vec::iter2 2011-10-27 21:17:51 -07:00
Brian Anderson
7a7940daca Add reverse iterators to std::vec 2011-10-27 21:09:02 -07:00
Brian Anderson
f1f0e6c06c Remove std::vec::eachi. Same function as iter2. 2011-10-27 20:50:10 -07:00
Brian Anderson
1a89e589a4 Implement vec::foldl without recursion 2011-10-27 20:47:06 -07:00
Brian Anderson
b5ed1c46c0 Add std::vec::iter 2011-10-27 20:30:06 -07:00
Brian Anderson
9c097d19e4 Remove std::int::eq_alias
This is the exact same function as int::eq
2011-10-27 18:23:06 -07:00
Brian Anderson
b16d9019a8 Make option::is_some option::is_none pure 2011-10-27 18:15:58 -07:00
Brian Anderson
91997e79aa Make vec::reversed take [mutable? T] 2011-10-27 17:49:13 -07:00
Brian Anderson
74a1e054eb Make std:vec::grow_fn take an init_op type 2011-10-27 17:06:49 -07:00
Brian Anderson
506ae934f8 Reorder std::vec so the documentation renders better
Put all types first, then predicates, then functions
2011-10-27 17:03:38 -07:00
Brian Anderson
2b85817af8 Convert various functions in std to take lambda blocks 2011-10-27 16:27:47 -07:00
Brian Anderson
cf2624106c Document std::bitv 2011-10-27 15:35:56 -07:00
Brian Anderson
e0715380dc Add more std docs 2011-10-27 14:54:18 -07:00
Brian Anderson
8222fa4e27 Use the std::term color constants in the codemap
Exported constants work now. Woo!
2011-10-27 13:52:00 -07:00
Matt Brubeck
5d6fe1a533 Remove uint::max/min in favor if math::max/min 2011-10-27 13:37:53 -07:00
Matt Brubeck
50d99ec32c Add documentation to std::uint 2011-10-27 13:37:53 -07:00
Matt Brubeck
a9f9227a1c Add std documentation for float and u8 functions 2011-10-27 13:37:53 -07:00
Matt Brubeck
9e4c2b6bc6 Mark uint add/sub/mul/div/rem functions as pure 2011-10-27 13:37:53 -07:00
Matt Brubeck
8dba51b87c Add function aliases for float operators 2011-10-27 13:37:53 -07:00
Matt Brubeck
361adf9f86 Add tests for the 'as' (cast) operator 2011-10-27 13:37:35 -07:00
Brian Anderson
26d839216b Add more std docs 2011-10-27 13:25:20 -07:00
Brian Anderson
00404ebe62 Cleanup in std::task 2011-10-27 11:29:04 -07:00
Brian Anderson
20e4f793e2 More std docs 2011-10-27 11:17:23 -07:00
Brian Anderson
17c651b3b0 Remove task::join_id
This is the old, racy way of joining to a task. It is no longer used.
2011-10-26 20:43:47 -07:00
Brian Anderson
4d669036f3 Add more std documentation 2011-10-26 18:32:34 -07:00
Brian Anderson
197c8543fe Add more std documentation 2011-10-26 11:47:42 -07:00
Brian Anderson
7ae757583a Begin documenting std and add doc generation using naturaldocs
Naturaldocs isn't really that great but it seems easier to get
something working than with doxygen, for which we would need to
convert rust code to something C++ish. We probably want to just
write a rustdoc utility at some point.
2011-10-25 18:01:52 -07:00
Marijn Haverbeke
013107a25c Properly take mutable object fields into account during alias analysis
Closes #1055
2011-10-25 17:57:26 +02:00
Marijn Haverbeke
cfdf193c46 Update our code to new type parameter kind syntax
Closes #1067
2011-10-25 15:56:55 +02:00
Marijn Haverbeke
58c82a8da2 Remove support for @/~-style type param kind annotation
Issue #1067
2011-10-25 15:50:45 +02:00
Marijn Haverbeke
8e7f4a3760 Register new snapshot 2011-10-25 15:23:57 +02:00
Marijn Haverbeke
2884c722fe Step one towards new type param kind syntax
Issue #1067

Needs a snapshot to finalize.
2011-10-25 14:31:56 +02:00
Brian Anderson
ea740a8bb0 Fix long lines 2011-10-24 17:23:34 -07:00
Niko Matsakis
c78b1639b4 fix c-stack-cdecl when used w/ i64 2011-10-24 17:03:18 -07:00
Niko Matsakis
d41385a69b kill errant log_err 2011-10-24 16:06:18 -07:00
Niko Matsakis
a5cbf4b13b remove (unused) fn rust_list_files from win32_fs; that is
defined in fs.rs
2011-10-24 16:06:18 -07:00
Niko Matsakis
8f2d75d53c switch over sqrt from llvm to c-stack-cdecl, exposing a bug in
the supported return types of upcall_c_stack
2011-10-24 16:06:18 -07:00
Niko Matsakis
d69a83b021 add implicit ctx 2011-10-24 16:06:18 -07:00
Niko Matsakis
e308f3346b remove unused task ptr arg 2011-10-24 16:06:18 -07:00
Niko Matsakis
c81808a9f7 update intrinsics file 2011-10-24 16:06:18 -07:00
Niko Matsakis
973a285371 move uses of rust ABI in tests to cdecl or c-stack-cdecl as appr
Note: I found a bug in c-stack-cdecl which codes not permit such
native functions to be used as values.  I added an xfail-test
(c-stack-as-value) documenting it.
2011-10-24 16:06:18 -07:00
Niko Matsakis
f8de679c1e move remaining task natives to cdecl ABI (run on rust stack) 2011-10-24 16:06:18 -07:00
Niko Matsakis
e838edc0b3 isolate those funcs in task that can run on the c stack 2011-10-24 16:06:17 -07:00
Niko Matsakis
fb48817ade work around bug when calling c-stack-cdecl fns from outside crate
In the main test, I call the wrapper instead of the native fn, as intended.
I also added an xfail-test that exercises the broken code path.  Will
file a bug.

Description of the broken code path:

The code path is that when we look up the external identifier we go through
trans_external_path() ->  type_of_ty_param_kinds_and_ty() ->
type_of_fn_from_ty() -> type_of_fn(), and type_of_fn() adds a lot of external
parameters. Problem is, I guess, that we don't pass the native ABI (or even the
fact that it's a native function!), just the types and kinds of the parameters.
2011-10-24 16:06:17 -07:00
Niko Matsakis
02d7a1e781 move sys fns into c-stack-cdecl and get_type_desc() into rusti
there is one test failure, stdtest/sys.rs, which inexplicably
(thus far) fails to compile because it invokes
sys::rustrt::last_os_error() instead of invoking
sys::last_os_error().  If stdtest/sys.rs is updated to invoke
the wrapper, it passes.  Still tracing the source of this error.
2011-10-24 16:06:17 -07:00
Niko Matsakis
0598635bdc migrate leak 2011-10-24 16:06:17 -07:00
Niko Matsakis
8eb336a705 migrate rust_run_program 2011-10-24 16:06:17 -07:00