Commit Graph

253 Commits

Author SHA1 Message Date
Brian Anderson
4601810747 core: Remove a useless test from option mod 2012-02-20 22:43:33 -08:00
Brian Anderson
4220dcf1e9 core: New task API 2012-02-20 18:58:04 -08:00
Brian Anderson
6b280c61ce core: Export future mod 2012-02-18 23:03:26 -08:00
Brian Anderson
23d36be1e9 core: Define futures in terms of local functions, of which port::recv is one possibility 2012-02-18 15:23:56 -08:00
Brian Anderson
4370188055 Merge pull request #1860 from erickt/master
add str::find_from_bytes and str::index_from_bytes
2012-02-18 13:17:12 -08:00
Brian Anderson
3411d19369 core: Make vec::push faster
This way makes it equivalent to the compiler's vec push, and is a lot
faster than calling vec::grow.
2012-02-17 18:15:52 -08:00
Marijn Haverbeke
ff42964546 Clean up some of trans using block combinators
`with_scope` and `with_cond` can be used to wrap a piece of code in a
scope block, or conditionalize it on a value, without doing all the
context-creation and jumping by hand.

Also renames @block_ctxt to block to reduce noise.
2012-02-17 23:03:12 +01:00
Graydon Hoare
2796ab6de9 Add a win32-ignore attribute to a should-fail test. 2012-02-17 11:28:18 -08:00
Erick Tryzelaar
23703c0661 core: add str::find_from. 2012-02-16 19:16:08 -08:00
Erick Tryzelaar
042a5222d1 core: rewrite str::byte_index to use vec functions 2012-02-16 18:35:45 -08:00
Erick Tryzelaar
d1c9b160ad core: slim down str.rs by importing some and none. 2012-02-16 17:30:56 -08:00
Brian Anderson
601f7144d8 core: Add comm::select2
Receives on two ports simultaneously
2012-02-16 12:53:18 -08:00
Marijn Haverbeke
67cc89f38d Rewrite exhaustiveness checker
Issue #352
Closes #1720

The old checker would happily accept things like 'alt x { @some(a) { a } }'.
It now properly descends into patterns, checks exhaustiveness of booleans,
and complains when number/string patterns aren't exhaustive.
2012-02-15 15:47:42 +01:00
Marijn Haverbeke
9ff5ba085d Fix bad line printing for parse errors
The code that extracted lines from partially-parsed files
was broken.

Closes #1848
2012-02-15 11:53:32 +01:00
Brian Anderson
ff6b71f78b core: Add core::future
Futures will be required for upcoming changes to the task API
2012-02-14 16:45:17 -08:00
Brian Anderson
b157f0b263 core: Add comm::peek for looking into the message queue 2012-02-14 14:07:06 -08:00
Brian Anderson
acabd821d2 Merge pull request #1831 from killerswan/str_fixes
(core::str) changes to find / find_bytes
2012-02-14 11:22:31 -08:00
Marijn Haverbeke
f2e880b750 Add [X].len() to core, use it in trans modules 2012-02-14 13:43:36 +01:00
Graydon Hoare
9caca02dac Merge pull request #1827 from uasi/from-cstr
Avoid extra memory allocations in core::str::from_cstr{,_len}
2012-02-13 11:29:58 -08:00
Kevin Cantu
69834646d2 (core::str) more test cases 2012-02-13 03:07:29 -08:00
Kevin Cantu
2600db4778 (core::str) added FIXME comment 2012-02-13 02:17:19 -08:00
Kevin Cantu
07ef368c60 (core::str) rename find_chars -> find 2012-02-13 01:57:05 -08:00
Kevin Cantu
c81867474a (core::str) add find_bytes and export it... 2012-02-13 01:56:58 -08:00
Kevin Cantu
748b63f63f (core::str) add find_chars and b2c_pos functions 2012-02-13 01:56:10 -08:00
Kevin Cantu
0e61fe2eea (core::str) use slice_bytes in starts_with for a little bit less string traversal 2012-02-13 01:56:10 -08:00
Brian Anderson
8309d50ff4 core: Add iter::filter_map 2012-02-12 22:30:58 -08:00
Brian Anderson
e360ddbd65 core: Add iterable implementation for strings 2012-02-12 22:17:10 -08:00
Brian Anderson
092c244d3a core: Rename iter::reverse to iter::reversed for consistency with vec mod 2012-02-12 22:11:42 -08:00
Brian Anderson
ad2f566ff2 core: Add abs functions for signed integer types 2012-02-12 22:04:06 -08:00
Brian Anderson
acc57a44fd core: Add compl functions for the rest of the integer types 2012-02-12 21:58:06 -08:00
Tomoki Aonuma
4d788be80d from_cstr and from_cstr_len are not unsafe, I think 2012-02-13 12:44:14 +09:00
Tomoki Aonuma
8d29e87056 core::str::from_cstr uses from_cstr_len 2012-02-13 12:44:14 +09:00
Tomoki Aonuma
e5cc9193f8 Avoid extra memory allocations in core::str::from_cstr_len 2012-02-13 12:44:14 +09:00
Brian Anderson
fde719f635 core: Implement foldl/r without copying the accumulator 2012-02-12 19:24:24 -08:00
Brian Anderson
d679c0eb34 core: Add iter::foldr 2012-02-12 19:24:24 -08:00
Brian Anderson
3edad3555e core: Add iter::count 2012-02-12 19:24:24 -08:00
Brian Anderson
85175d639f core: Add iter::reverse 2012-02-12 19:24:24 -08:00
Brian Anderson
c21db3bbc2 core: Add iter::min/max 2012-02-12 19:24:24 -08:00
Kevin Cantu
f5e1108fc3 (core::str) comments and cleanup 2012-02-12 15:30:21 -08:00
Kevin Cantu
faa513b1f6 (core::str) fixed replace, fixed starts_with, and added more find/contains/replace test cases 2012-02-12 15:30:21 -08:00
Kevin Cantu
2ba44e24d5 (core::str) rename byte_len_range -> substr_len_bytes and
rename char_len_range -> substr_len_chars
2012-02-12 15:30:20 -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
5fb0906f43 core: Formulate all unsigned max_values as 0 - 1 for consistency 2012-02-12 00:00:15 -08:00
Brian Anderson
4838d7860e core: Add min/max functions for all int types 2012-02-11 23:56:53 -08:00
Brian Anderson
3bdb627b5d core: Make uint::min/max pure 2012-02-11 23:52:40 -08:00
Brian Anderson
910c6a5df8 core: Fill out missing functions for basic types 2012-02-11 23:49:13 -08:00
Brian Anderson
87d17be846 core: Add modules for remaining scalar types 2012-02-11 23:18:26 -08:00
Tomoki Aonuma
70b04a14d1 Add a test for core::str::from_cstr_len 2012-02-12 13:28:54 +09:00
Tomoki Aonuma
6408d54c13 Implement core::str::from_cstr_len, close #1666 2012-02-12 13:25:15 +09:00