Niko Matsakis
e65c39c100
add #[inline] to vec::iter
2012-02-28 06:31:29 -08:00
Graydon Hoare
324ecb58a7
Add libc module to libcore and utility file to help generate it.
2012-02-27 18:34:42 -08:00
Niko Matsakis
f3ca50c9ca
Encode/decode AST into metadata, re-instantiate inlined items
2012-02-24 20:46:27 -08:00
Marijn Haverbeke
780f8277f4
Finish cleanup of core::str
...
Closes #1849
2012-02-23 17:00:19 +01:00
Marijn Haverbeke
1d2b4b97ed
Optimize str::replace
2012-02-23 17:00:19 +01:00
Marijn Haverbeke
d802c1fbd2
Various cleanups and optimizations in core::str
2012-02-23 17:00:19 +01:00
Marijn Haverbeke
35e9192762
Make str::pop_char and str::unsafe::pop_byte efficient
...
O(1) rather than O(string len)
2012-02-23 17:00:19 +01:00
Kevin Cantu
c2984b46b4
(core::str) comments
2012-02-23 17:00:19 +01:00
Kevin Cantu
961b6446b6
(core::str) rename ++
2012-02-23 17:00:19 +01:00
Kevin Cantu
c3318f29fe
(core::str) rename substr_len_bytes to substr_len, and delete unused byte_index[_from]
2012-02-23 17:00:19 +01:00
Kevin Cantu
7782f5d692
(core::str) remove len_bytes alias
2012-02-23 17:00:19 +01:00
Kevin Cantu
1b957c0942
(core::str) replace uses of unsafe::slice_bytes; replace find[_from]_bytes with find[_from]
2012-02-23 17:00:19 +01:00
Kevin Cantu
cec053487c
(core::str) stop using index_chars
2012-02-23 17:00:19 +01:00
Kevin Cantu
6ea3d7935e
(core::str) replace byte_index[_from] with index[_from]
2012-02-23 17:00:19 +01:00
Kevin Cantu
280633a728
(core::str) do some replacements
2012-02-23 17:00:19 +01:00
Kevin Cantu
2756a61e34
(core::str) add index, index_from, rindex which return byte positions of chars; rename find to find_chars; add fixmes to delete byte_index, byte_index_from
2012-02-23 17:00:19 +01:00
Kevin Cantu
e1d04e0062
(core::str) add a safe byte slice and maybe_slice ++
2012-02-23 17:00:19 +01:00
Kevin Cantu
7c78b7dfed
(core::str) add a safe byte slice and maybe_slice
2012-02-23 17:00:19 +01:00
Kevin Cantu
454b53a7c2
(core::char) rename slice -> slice_chars
2012-02-23 17:00:19 +01:00
Kevin Cantu
1cd5a0945a
(core::str) rename rindex -> rindex_chars
2012-02-23 17:00:19 +01:00
Kevin Cantu
969fdf419c
(core::str) rename index -> index_chars
2012-02-23 17:00:19 +01:00
Kevin Cantu
8ea96169ff
(core::str) make len an alias for len_bytes ++
2012-02-23 17:00:19 +01:00
Kevin Cantu
669ff690fd
(core::str) make len an alias for len_bytes
2012-02-23 17:00:19 +01:00
Kevin Cantu
98447f5236
(core::str) mostly rename len -> len_chars
2012-02-23 17:00:19 +01:00
Marijn Haverbeke
a3b655f8e3
Fix uint/u64 confusion
...
Causes a failure on 32-bit platforms
2012-02-22 13:44:55 +01:00
Marijn Haverbeke
ffd50b9cdf
Make the various from_str functions return options
...
So that they can be used with user input without causing task
failures.
Closes #1335
2012-02-22 13:18:15 +01:00
Marijn Haverbeke
72373438d2
Add core::to_str module
...
Provides a central iface for the various stringification
functions.
2012-02-22 13:06:38 +01:00
Marijn Haverbeke
ad03761a97
Remove preconditions from libraries
...
Closes #1805
2012-02-22 11:47:47 +01:00
Brian Anderson
a896eb326e
core: Fix unused variable warning
2012-02-21 14:25:51 -08:00
Brian Anderson
6527fc3925
core: Fix to_str_exact for floats with no decimal component
2012-02-21 14:25:31 -08:00
Brian Anderson
910a32c7c7
core: Add option::unwrap
...
This function uses some unsafe code to move the value out of an option.
2012-02-21 13:55:50 -08:00
Brian Anderson
9691ce18a2
core: Resolve a FIXME in str module
2012-02-21 01:03:13 -08:00
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