Commit graph

1934 commits

Author SHA1 Message Date
Kevin Atkinson
a803a14b56 Bug fix to accept $ in 0th pos, (ie #ast{$(x) + ...}).
Note: part from Niko Matsakis commit: rewrite assert to accept a $ in
0th pos.
2012-02-14 19:37:33 -08:00
Kevin Atkinson
3eef8d1419 Correctly handle the character position at the EOF.
Fixes issue #1785.
2012-02-14 19:37:33 -08:00
Kevin Atkinson
0e44133e7c Do a better job of reporting source location for files (i.e. filemap)
that are really a substr of another file.
2012-02-14 19:37:33 -08:00
Brian Anderson
d5e7f0d113 rt: Don't kill tasks while they are in a callback from C 2012-02-14 11:24:09 -08:00
Brian Anderson
3f4872f032 test: Test yielding in crust functions 2012-02-14 11:24:09 -08:00
Brian Anderson
a393fb3221 rt: Maintain stack ptrs correctly when returning from stack switches 2012-02-14 11:24:09 -08:00
Brian Anderson
214cdd0dee rustc: Translate crust functions 2012-02-14 11:24:09 -08:00
Brian Anderson
c4c89dd684 rustc: Translate the value of crust functions 2012-02-14 11:24:09 -08:00
Brian Anderson
0a503228f6 rustc: Typecheck crust functions as *u8 2012-02-14 11:24:09 -08:00
Brian Anderson
305cbf9b8e rustc: Parse crust functions 2012-02-14 11:24:09 -08:00
Marijn Haverbeke
90324a1978 XFAIL bind-methods test until I figure out what is going wrong
It is not Valgrind-clean.
2012-02-14 13:54:41 +01:00
Marijn Haverbeke
57c7645cb8 Allow static method calls to be bound
This allows you to take the value of, for example, `[1].len`, or bind
it with `bind x.map(_)` syntax.

I'm holding off on implementing this for dynamic methods (those on
bounded type parameters or iface types) until it's clearer what we
will do with monomorphization.

Issue #435
2012-02-14 13:43:36 +01:00
Marijn Haverbeke
f2e880b750 Add [X].len() to core, use it in trans modules 2012-02-14 13:43:36 +01:00
Brian Anderson
f3dba33043 test: Add test for #1821 2012-02-13 15:58:14 -08:00
Marijn Haverbeke
94d4dcdbf0 Fix bug in handling of block functions in last-use analysis
It would fail to start out with a fresh scope when going over
a loop or block function for the second time, and thus not
recognize last uses of locals defined inside the block.

Closes #1818
2012-02-13 17:55:40 +01:00
Niko Matsakis
520c3f5f79 correct error message and add to test 2012-02-13 07:33:16 -08:00
Niko Matsakis
4eb52f69a9 do not fail if iface/impl method have different number of parameters 2012-02-13 06:50:58 -08:00
Niko Matsakis
a7641e99e8 remove leading ::, new tests 2012-02-13 06:50:58 -08:00
Kevin Cantu
2b4f5136a5 (core::str) rename byte_len -> len_bytes and rename char_len -> len 2012-02-12 15:30:20 -08:00
Kevin Cantu
944f5a6598 (core::str) move push_byte, push_bytes, pop_byte, and shift_byte into str::unsafe 2012-02-12 15:30:20 -08:00
Brian Anderson
005a3efb8b test: Fix cros-crate-glob-collision 2012-02-11 18:20:02 -08:00
Niko Matsakis
3f15a28b16 correct fully qualified type names to include the crate; add tests (take 2)
This reverts commit fc023d91c7.
2012-02-11 14:09:52 -08:00
Niko Matsakis
13d743093b rewrite to use ctypes types 2012-02-11 10:14:41 -08:00
Niko Matsakis
b106ef8116 make bind syntax unnecessary: just use _ for one of the arguments 2012-02-11 10:14:41 -08:00
Niko Matsakis
fc023d91c7 Revert prior commit until I have time to track down the valgrind error
This reverts commit 2ec3a0b608.
2012-02-11 09:49:02 -08:00
Niko Matsakis
2ec3a0b608 correct fully qualified type names to include the crate; add tests
fixes #1745
2012-02-10 21:53:17 -08:00
Niko Matsakis
d972226567 remove executable that was accidentally included 2012-02-10 20:48:29 -08:00
Niko Matsakis
fdddf8f9e1 put serializer into the build and encode full item paths 2012-02-10 20:48:28 -08:00
Brian Anderson
17110fb28b test: Add tests for #1802 2012-02-10 15:43:35 -08:00
Marijn Haverbeke
7f1ea3ef6a Don't allow binding patterns to bind keywords
Closes #1586
2012-02-10 15:54:47 +01:00
Marijn Haverbeke
74d4e2a32e Add compile-fail tests for interfaces/impls
Closes #1475
2012-02-10 13:31:33 +01:00
Tim Chevalier
503dec1d62 Further WIP on classes
Changes to resolve and typeck. Still nothning working yet.
2012-02-09 14:36:43 -08:00
Marijn Haverbeke
50fb4c30ed Increase precedence of as operator
Closes #1717
2012-02-09 11:58:08 +01:00
Brian Anderson
35ba9715fa core: Add task::spawn_sched
This function creates a new scheduler with a specified number of threads and
immediately executes a task on it. The scheduler is configured to terminate
when the task dies. This is the minimum API necessary to enable blocking C
calls.
2012-02-08 15:42:51 -08:00
Brian Anderson
2f4e7c157e rt: Export a scheduler API 2012-02-08 15:42:51 -08:00
Brian Anderson
7c8d128e1f bench: Add shootout-spectralnorm 2012-02-08 01:06:16 -08:00
Kevin Cantu
a3f5626ad1 String split renaming:
* Renamed str::split -> str::split_byte
* Renamed str::splitn -> str::splitn_byte
* Renamed str::split_func -> str::split
* Renamed str::split_char -> str::split_char
* Renamed str::split_chars_iter -> str::split_char_iter
* Added u8::is_ascii
* Fixed the behavior of str::split_str, so that it matches split_chars
  and split (i.e. ["", "XXX", "YYY", ""] == split_str(".XXX.YYY.", "."))
* Fixed str::split_byte and str::splitn_byte so that they handle
  splitting UTF-8 strings on a given UTF-8/ASCII byte and also handle ""
  as the others do
2012-02-07 16:25:35 -08:00
Marijn Haverbeke
6ed8d03784 Make sure iface_methods are set before they are accessed
Closes #1761
2012-02-06 09:56:42 +01:00
Marijn Haverbeke
91da710d86 Add monad iface test 2012-02-06 09:56:41 +01:00
Brian Anderson
da61e1ff15 test: Add test for issue #1460 2012-02-05 20:42:05 -08:00
Brian Anderson
1b3339df63 test: Issue #953, not #959 2012-02-05 18:29:07 -08:00
Brian Anderson
292f3e0958 test: Add an xfailed test for issue #959 2012-02-05 18:27:15 -08:00
Brian Anderson
cbeeb13dfd test: Add an xfailed test for issue #929 2012-02-05 18:24:17 -08:00
Brian Anderson
80cd6aa96e test: Update and un-xfail compile-fail/tag-that-dare-not... 2012-02-05 18:06:54 -08:00
Brian Anderson
0b43bf9782 test: Add test for #901. Closes #901 2012-02-05 17:54:52 -08:00
Brian Anderson
34aa956e68 test: Resolve some FIXMEs 2012-02-05 17:05:24 -08:00
Kevin Atkinson
1d855ebc51 Remove support for $(...) form of quasi-quotes, use #ast{...} instead. 2012-02-05 15:38:27 -08:00
Niko Matsakis
9f0239ce9c add a test where mode inference ought to fail 2012-02-05 13:59:09 -08:00
Niko Matsakis
dd51031390 new test case 2012-02-05 10:37:07 -08:00
Niko Matsakis
daf0d63a59 new test showing off the improved inference 2012-02-05 09:56:18 -08:00
Brian Anderson
30a671dc0c bench: Tweak threadring benchmark so it pretty-prints 2012-02-04 20:34:51 -08:00
Brian Anderson
b4e221bf90 bench: Add threadring shootout benchmark 2012-02-04 20:01:55 -08:00
Brian Anderson
5d4b372902 Revert "bench: Add threadring shootout benchmark"
This reverts commit cdb246f832.
2012-02-04 19:50:45 -08:00
Brian Anderson
cdb246f832 bench: Add threadring shootout benchmark 2012-02-04 18:00:59 -08:00
Tim Chevalier
f3343b3571 Beginnings of front-end support for classes
Added class support to the parser, prettyprinter, fold, and visit.
(See Issue 1726.)

This is WIP -- the test case is xfailed, and attempting to compile
it will error out in resolve.
2012-02-03 22:47:35 -08:00
Ted Horst
9b46e875cc add third arg for output path, default to no output 2012-02-03 20:49:14 -08:00
Ted Horst
63ae16f752 fix formatting 2012-02-03 20:49:14 -08:00
Ted Horst
e7738ca38b add mandelbrot image generator from shootout 2012-02-03 20:49:13 -08:00
Graydon Hoare
8fc624bc08 Fix various drift issues in the qq branch. 2012-02-03 20:54:18 -07:00
Kevin Atkinson
dbb13883f7 Additional testcase. 2012-02-03 20:54:18 -07:00
Kevin Atkinson
42e25b2bb9 Type anti-quotes now work, add test case. 2012-02-03 20:54:17 -07:00
Kevin Atkinson
5f6a1159bb Fix q-q so that non-expression q-q actually work when there is embed anti-q. 2012-02-03 20:54:00 -07:00
Kevin Atkinson
a2dde9a692 Allow anti-quotes to also be ast::ty rather than just ast::expr. 2012-02-03 20:41:49 -07:00
Kevin Atkinson
f7fab77102 Add testcase. 2012-02-03 20:41:49 -07:00
Kevin Atkinson
5ef53382ae Add support for parsing quasi-quotes, doesn't do anything useful yet. 2012-02-03 20:23:49 -07:00
Marijn Haverbeke
c976b7c623 Fix tests for str::le patch 2012-02-03 14:32:23 +01:00
Marijn Haverbeke
c1b075d042 Remove experimental GC code
It's been sitting unused long enough to have bitrotted completely.
2012-02-03 11:34:12 +01:00
Brian Anderson
57cad61353 rt: Remove task pinning. Does nothing 2012-02-02 18:10:24 -08:00
Brian Anderson
18de0f2aeb rt: Rename task_sleep intrinsic to task_yield. Remove usec param 2012-02-02 18:10:24 -08:00
Marijn Haverbeke
6a7de641da Add test case for issue #1733 2012-02-02 10:30:07 +01:00
Kevin Cantu
8f367ebfeb Rename (again) str::unsafe::slice -> str::unsafe::slice_bytes and
str::unsafe::safe_slice -> str::unsafe::slice_bytes_safe_range
2012-02-01 21:56:53 -08:00
Kevin Cantu
c71667d9d2 Propagating unsafe::slice 4 2012-02-01 21:56:53 -08:00
Marijn Haverbeke
856a544d0c Remove native types from stdlib 2012-02-01 12:23:13 +01:00
Tim Chevalier
e5d095d67e Change option::t to option
Now that core exports "option" as a synonym for option::t, search-and-
replace option::t with option.

The only place that still refers to option::t are the modules in libcore
that use option, because fixing this requires a new snapshot
(forthcoming).
2012-01-31 17:05:20 -08:00
Kevin Cantu
c7454f5595 Rename str::to_chars -> str::chars 2012-01-31 14:29:11 -08:00
Tim Chevalier
45c1dfe5b3 Don't compute pre- and postconditions for item_consts
Since item_consts can't refer to or modify local variables, they
don't participate in typestate and thus get empty pre and
postconditions by default.

Closes #1660
2012-01-31 11:52:46 -08:00
Tim Chevalier
fba35e1a3c Require alts to be exhaustive
middle::check_alt does the work. Lots of changes to add default cases
into alts that were previously inexhaustive.
2012-01-31 10:08:24 -08:00
Brian Anderson
0e498da47e rustc: Allow attributes on methods. Closes #1709 2012-01-30 11:43:45 -08:00
Paul Woolcock
a02493b969 Fix last failing test
All tests now pass, without the ternary operator.
2012-01-30 18:21:12 +01:00
Paul Woolcock
e1251f7b00 Change all ternary ops to if/then/else
All the files below had at least one instance of the ternary operator
present in the source.  All have been changed to the equivalent
if/then/else expression.
2012-01-30 18:21:01 +01:00
Paul Woolcock
e1f15a71e3 Alter/remove tests that include/concern ternary
3 tests, pretty/block-disambig.rs, run-pass/operator-overloading.rs,
and run-pass/weird-exprs.rs, all included the ternary operator.  These
were changed to use the if-then-else construct instead.

2 tests, run-pass/block-arg-in-ternary.rs and run-pass/ternary.rs, were
only there because of the ternary operator, and were removed.
2012-01-30 18:20:05 +01:00
Marijn Haverbeke
964bd485c6 Revert self types 2012-01-30 11:37:52 +01:00
Brian Anderson
fa13fd9d64 rt: Remove set_min_stack 2012-01-29 21:27:37 -08:00
Brian Anderson
cad4918b2a core: Remove sys::set_min_stack
This was a temporary hack with global effect. Eventually there will
be a real solution for controlling stack sizes.
2012-01-29 21:27:09 -08:00
Brian Anderson
53dbde6cc2 rustc: Make 'attempted access of field' error non-fatal 2012-01-27 16:58:27 -08:00
Brian Anderson
3321880f13 Merge remote-tracking branch 'killerswan/fixing_strings_2'
Conflicts:
	src/comp/driver/driver.rs
	src/comp/middle/trans/base.rs
	src/comp/syntax/parse/lexer.rs
2012-01-27 16:44:40 -08:00
Marijn Haverbeke
e48bf6f3f4 Make occurs check in ty::fixup_vars more reliable
It wouldn't detect cycles that went through several type vars before.

Closes #1464
2012-01-27 18:58:52 +01:00
Marijn Haverbeke
dc55c06aa3 Properly check enum types for recursion
Closes #742
2012-01-27 16:03:43 +01:00
Marijn Haverbeke
b80f0a3c9f Use the method name 'unary-' for overloading negation
It's less likely to clash with something than 'neg'.

Issue #1520
2012-01-27 10:06:53 +01:00
Brian Anderson
28fbb19664 rustc: Switch the --no-core switch to a #[no_core] attribute 2012-01-26 16:43:33 -08:00
Brian Anderson
5610205363 rustc: Move core injection to its own module 2012-01-26 16:23:48 -08:00
Marijn Haverbeke
6bead0e4cc Use operator names for operator methods
The methods used to implement operators now simply use
the name of the operator itself, except for unary -, which is called
min to not clash with binary -. Index is called [].

Closes #1520
2012-01-26 15:52:28 +01:00
Marijn Haverbeke
888262b337 Allow operator overloading of the indexing operator
The method `op_index` (which takes a single argument) is used for
this.

Issue #1520
2012-01-26 15:23:11 +01:00
Marijn Haverbeke
87b064b249 First stab at operator overloading
When no built-in interpretation is found for one of the operators
mentioned below, the typechecker will try to turn it into a method
call with the name written next to it. For binary operators, the
method will be called on the LHS with the RHS as only parameter.

Binary:

    +   op_add
    -   op_sub
    *   op_mul
    /   op_div
    %   op_rem
    &   op_and
    |   op_or
    ^   op_xor
    <<  op_shift_left
    >>  op_shift_right
    >>> op_ashift_right

Unary:

    -   op_neg
    !   op_not

Overloading of the indexing ([]) operator isn't finished yet.

Issue #1520
2012-01-26 14:25:06 +01:00
Brian Anderson
2999479a2d rustc: Allow attributes on enum variants. Closes #1663 2012-01-25 16:24:06 -08:00
Brian Anderson
4168101b03 test: Un-xfail run-pass/tag-auto-disr-val-shape 2012-01-25 12:44:13 -08:00
Brian Anderson
19a9a475a6 test: Add regression test for #1659 2012-01-25 12:40:08 -08:00
Brian Anderson
ba7299ba65 test: Un-xfail run-pass/tag-disr-val-shape
Fixed by 96f1eda6d0
2012-01-25 12:34:37 -08:00
Marijn Haverbeke
2d4d8e8bdb Implement implicit self type parameters for ifaces
Closes #1661
2012-01-25 20:47:11 +01:00
Kevin Cantu
c7b23f9a86 Replacing str::unsafe_from_bytes with str::from_bytes (part 1) 2012-01-25 00:53:17 -08:00