Commit graph

43 commits

Author SHA1 Message Date
Patrick Walton
ccfbb74f11 rustc: Move maps over to interior vectors 2011-07-08 16:37:43 -07:00
Marijn Haverbeke
6fd6fdea93 Move everything syntax-related to syntax/, break deps on rest of compiler
src/comp/syntax is currently just a sub-module of rustc, but it will,
in the near future, be its own crate. This includes:

 - The AST data structure
 - The parser
 - The pretty-printer
 - Visit, walk, and fold
 - The syntax extension system
 - Some utility stuff that should be in the stdlib*

*) Stdlib extensions currently require a snapshot before they can be
   used, and the win build is very broken right now. This is temporary
   and will be cleaned up when one of those problems goes away.

A lot of code was moved by this patch, mostly towards a more organized
layout. Some package paths did get longer, and I guess the new layout
will take some getting used to. Sorry about that!

Please try not to re-introduce any dependencies in syntax/ on any of
the other src/comp/ subdirs.
2011-07-05 15:57:21 +02:00
Graydon Hoare
ce72993488 Reformat source tree (minus a couple tests that are still grumpy). 2011-06-15 11:19:50 -07:00
Marijn Haverbeke
537d879dc1 Properly handle lifetime of aliases in nested blocks
There was a bug that would cause the alias analyser to allow you to
invalidate an alias that was no longer directly referred to, even if
another alias was rooted in it. It now properly tracks dependencies
between live aliases.

Required another case of copying values in map.rs.
2011-06-09 14:19:13 +02:00
Marijn Haverbeke
77c1b9650f Some more workarounds to please the alias checker
Some of the vec utilities now only work on immutable vecs, since they
would have to be rewritten to do a lot more copying to be alias-safe.

Some forced copying was added to map.rs, showing a weakness in the
alias checker (or maybe the alias system): when fn args are passed
into a function, calling them must assume all aliases that are not
immutably rooted (directly connected to a local or temporary without
any mutable edges) become invalid. This will be a drag on functional
programming in Rust.

Work around alias issues in the stdlib
2011-06-09 13:08:39 +02:00
Brian Anderson
ed0eb8f45a stdlib: Remove unneeded type params from alt patterns 2011-05-31 01:23:53 -04:00
Brian Anderson
820ccf4a13 stdlib: Do tail calls in std::map. Remove FIXMEs 2011-05-22 12:28:20 -04:00
Brian Anderson
2d17d9101d stdlib: Use if/alt expressions in std::map 2011-05-22 12:28:20 -04:00
Marijn Haverbeke
09d8ef8d51 Finally rename std::_xxx to std::xxx
Except for _task, which is still a keyword.
2011-05-17 20:41:41 +02:00
Marijn Haverbeke
3816e57fd2 Downcase std modules again, move to :: for module dereferencing
This should be a snapshot transition.
2011-05-12 21:30:44 +02:00
Marijn Haverbeke
a3ec0b1f64 Rename std modules to be camelcased
(Have fun mergining your stuff with this.)
2011-05-06 22:51:19 +02:00
Graydon Hoare
5fe21b5af0 Skip likely-zero initial probe, speed up map.rs. 2011-04-25 04:12:33 +00:00
Graydon Hoare
d3eb3b42aa Minimize calls to hash function in map.rs 2011-04-22 01:06:20 -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
Patrick Walton
bcf04e253f Revert "Remove usages of case(_) { fail; } since the compiler does this automatically". When we have exhaustiveness checking, "case(_) { fail; }" will be useful to silence warnings.
This reverts commit 92a716d862.
2011-03-22 14:02:52 -07:00
Brian Anderson
92a716d862 Remove usages of case(_) { fail; } since the compiler does this automatically 2011-03-22 08:11:34 -07:00
Patrick Walton
47d650e25b rustc: Box the tuples returned by hashmap.items() for now since we don't have alias iterators yet 2011-03-18 15:18:45 -07:00
Patrick Walton
0cf16e77ca Add "mutable?" to _vec in the standard library; fix callers 2011-03-18 14:01:03 -07:00
Graydon Hoare
11a10c7a7b Remove redundant imports in lib (rustc doesn't like 'std' as a synonym for root within std.rc anyway) 2011-03-09 17:29:18 -08:00
Patrick Walton
77ff12c435 rustboot: Don't use walk to traverse statements in type.ml; fixes redundant checking, improves diagnostics. Also report untyped slots. 2010-11-18 14:19:06 -08:00
Patrick Walton
adb1754e4d Move the option type to its own module 2010-11-05 11:18:40 -07:00
Graydon Hoare
7db115834f Split out stratum-checking pass, implement more-strict (overly aggressive) impure-effect checking. 2010-11-02 15:24:46 -07:00
Graydon Hoare
da13c508d8 First pass on splitting stratum and opacity off of effects. WIP. 2010-11-02 11:11:58 -07:00
Graydon Hoare
23a00fd092 Disable use of parametric tail call in map.rs, they don't presently work. 2010-10-18 16:04:47 -07:00
Graydon Hoare
b970563fe3 Patchwork of attempted fixes to effect system and gc system; eventually give up and disable it entirely in the runtime. Will need extensive reworking. 2010-09-29 17:22:13 -07:00
Graydon Hoare
4d17283371 Add 'items' iter to hashmap. 2010-09-22 17:04:08 -07:00
Graydon Hoare
2880ecd73f Reformat standard library; no code changes. 2010-09-22 15:44:13 -07:00
Graydon Hoare
b549721a2e Tighten pattern parsing on 0-ary constructors. 2010-09-21 16:18:47 -07:00
Graydon Hoare
c5f4789d5b Bind pattern slots with ?, drop parens from 0-ary tag constructors, translate 0-ary constructors as constants. Rustc loses ~300kb. 2010-09-20 23:56:43 -07:00
Graydon Hoare
a9e2327a18 Switch tags to purely nominal, removing TY_iso and TY_idx. Seems to mostly work, possibly a little bumpy. Changes a lot. 2010-09-09 15:59:29 -07:00
Roy Frostig
66b5b9567c Test the hashmap more, exercising hash collision, element removal, and a forced rehashing that actually causes elements to change buckets. In the process, find a bug in hashmap's remove() and fix it. 2010-08-26 19:44:38 -07:00
Roy Frostig
c40fed5804 Actually switch to using the bigger hashmap once a it finishes growing and rehashing. 2010-08-25 17:42:36 -07:00
Graydon Hoare
e846643d23 Fix mod-bug in std.map, work around bug in closure typaram capture, enable insert-tests in lib-map.rs. 2010-08-24 17:23:09 -07:00
Graydon Hoare
9fc4fc6692 Add _uint module to std, move some code around. 2010-08-20 11:42:44 -07:00
Graydon Hoare
935b4347e2 Mop up workarounds in stdlib no longer required as issue #93 is closed. 2010-08-05 10:10:39 -07:00
Roy Frostig
299657550e Have hashmap's insert method overwrite on existing-key insertion and return true iff overwrite did not occur. 2010-08-03 18:57:54 -07:00
Roy Frostig
6277b462e9 More stdlib hashmap work. Add a simple test and XFAIL it due to a valgrind-spotted UMR. 2010-08-03 18:43:57 -07:00
Roy Frostig
d5fd81174e Pass parametric types by-alias in various stdlib spots. 2010-08-03 18:06:31 -07:00
Roy Frostig
085790a73a More stdlib hashmap bits (plus some drive-by extras). 2010-08-03 17:52:35 -07:00
Graydon Hoare
8030757624 Switch machine-type lexemes to use suffixes. Remove support for foo(bar) as a cast notation. Closes #129. 2010-07-27 19:21:51 -07:00
Roy Frostig
9c81889ad2 Add a (coarse, first-pass) deque implementation to stdlib. 2010-07-20 18:03:09 -07:00
Roy Frostig
fb68286700 Add incomplete hashmap implementation to stdlib. 2010-07-16 18:14:52 -07:00