about summary refs log tree commit diff
path: root/src/lib/_vec.rs
AgeCommit message (Collapse)AuthorLines
2011-05-17Finally rename std::_xxx to std::xxxMarijn Haverbeke-318/+0
Except for _task, which is still a keyword.
2011-05-16Rewrite everything to use [] instead of vec() in value position.Graydon Hoare-17/+17
2011-05-12Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke-0/+318
This should be a snapshot transition.
2011-05-06Rename std modules to be camelcasedMarijn Haverbeke-318/+0
(Have fun mergining your stuff with this.)
2011-05-05Remove 'deprecated mutable...' from our codeMarijn Haverbeke-4/+4
This should make compilation a bit less noisy.
2011-05-02Un-revert "Use different syntax for checks that matter to typestate", fixing ↵Patrick Walton-5/+6
the problem. This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
2011-05-02Revert "Use different syntax for checks that matter to typestate"Graydon Hoare-6/+5
This reverts commit aa25f22f197682de3b18fc4c8ba068d1feda220f. It broke stage2, not sure why yet.
2011-05-02Use different syntax for checks that matter to typestateTim Chevalier-5/+6
This giant commit changes the syntax of Rust to use "assert" for "check" expressions that didn't mean anything to the typestate system, and continue using "check" for checks that are used as part of typestate checking. Most of the changes are just replacing "check" with "assert" in test cases and rustc.
2011-04-28stdlib: Provide "array" as a friendlier shorthand for "vec[mutable? T]"Patrick Walton-17/+18
2011-04-28Further work on typestate_checkTim Chevalier-0/+15
Lots of work on typestate_check, seems to get a lot of the way through checking the standard library. * Added for, for_each, assign_op, bind, cast, put, check, break, and cont. (I'm not sure break and cont are actually handled correctly.) * Fixed side-effect bug in seq_preconds so that unioning the preconditions of a sequence of statements or expressions is handled correctly. * Pass poststate correctly through a stmt_decl. * Handle expr_ret and expr_fail properly (after execution of a ret or fail, everything is true -- this is needed to handle ifs and alts where one branch is a ret or fail) * Fixed bug in set_prestate_ann where a thing that needed to be mutated wasn't getting passed as an alias * Fixed bug in how expr_alt was treated (zero is not the identity for intersect, who knew, right?) * Update logging to reflect log_err vs. log * Fixed find_locals so as to return all local decls and exclude function arguments. * Make union_postconds work on an empty vector (needed to handle empty blocks correctly) * Added _vec.cat_options, which takes a list of option[T] to a list of T, ignoring any Nones * Added two test cases.
2011-04-27stdlib/rt: Add an unsafe function to cast immutable vectors to mutable onesPatrick Walton-0/+2
2011-04-19Handle nested items correctly in typestate_checkTim Chevalier-1/+1
Summary says it all. Actually, only nested objects and functions are handled, but that's better than before. The fold that I was using before to traverse a crate wasn't working correctly, because annotations have to reflect the number of local variables of the nearest enclosing function (in turn, because annotations are represented as bit vectors). The fold was traversing the AST in the wrong order, first filling in the annotations correctly, but then re-traversing them with the bit vector length for any outer nested functions, and so on. Remedying this required writing a lot of tedious boilerplate code because I scrapped the idea of using a fold altogether. I also made typestate_check handle unary, field, alt, and fail. Also, some miscellaneous changes: * added annotations to blocks in typeck * fix pprust so it can handle spawn * added more logging functions in util.common * fixed _vec.or * added maybe and from_maybe in option * removed fold_block field from ast_fold, since it was never used
2011-04-19Remove effect system from src.Graydon Hoare-1/+1
2011-04-15stdlib: Add some vector functions: empty, empty_mut, grow_set, and freeze. ↵Patrick Walton-4/+31
Change _vec.grow to use uint arguments.
2011-04-13Make expr_while work in typestate_checkTim Chevalier-0/+11
Also did some refactoring in typestate_check. All test cases in compile-fail that involve uninitialized vars now fail correctly! (All eight of them, that is.)
2011-04-06Continued sketching out code for checking states against preconditions.Tim Chevalier-0/+21
It's still sketchy. I added a typestate annotation field to statements tagged stmt_decl or stmt_expr, because a stmt_decl statement has a typestate that's different from that of its child node. This necessitated trivial changes to a bunch of other files all over to the compiler. I also added a few small standard library functions, some of which I didn't actually end up using but which I thought might be useful anyway.
2011-04-01Started adding support for typestate checking.Tim Chevalier-0/+23
I added a new field to the ast "ann" type for typestate information. Currently, the field contains a record of a precondition bit vector and postcondition vector, but I tried to structure things so as to make it easy to change the representation of the typestate annotation type. I also had to add annotations to some syntactic forms that didn't have them before (fail, ret, be...), with all the boilerplate changes that that would imply. The main call to the typestate_check entry point is commented out and the actual pre-postcondition algorithm only has a few cases implemented, though the overall AST traversal is there. The rest of the typestate algorithm isn't implemented yet.
2011-03-24rustc: Open "use"d crates; add a _vec.vec_from_buf() method along the way; ↵Patrick Walton-1/+7
XFAIL use-import-export.rs in rustc
2011-03-21Add a "last" function to return the last element of a vector to the standard ↵Patrick Walton-0/+12
library
2011-03-18Add "mutable?" to _vec in the standard library; fix callersPatrick Walton-14/+15
2011-03-18Add some mutable variants of vector functions to the standard libraryPatrick Walton-0/+25
2011-03-16Switch all vases of vec += elt to vec += vec. Prohibit former in rustboot. ↵Graydon Hoare-16/+20
Tweak std lib vec fns in process.
2011-03-09Remove redundant imports in lib (rustc doesn't like 'std' as a synonym for ↵Graydon Hoare-1/+0
root within std.rc anyway)
2010-11-09Implement a map2() function in std._vecPatrick Walton-0/+18
2010-11-09Support a special const-value refcount, use it for const strings.Graydon Hoare-2/+7
2010-11-05Move the option type to its own modulePatrick Walton-2/+2
2010-10-22Change vec slice to use uint, add push/pop/shift/unshift.Graydon Hoare-6/+29
2010-09-22Reformat standard library; no code changes.Graydon Hoare-66/+75
2010-09-03Test multi-ref'ed vec growth more seriously than before.Roy Frostig-0/+5
2010-08-19Make _io.buf_reader read more than 0 bytes at a time.Roy Frostig-4/+20
2010-08-12Address FIXME in _vec waiting on closed issue #108.Roy Frostig-5/+4
2010-08-12Add vec debugging utility to _vec module.Roy Frostig-0/+5
2010-08-11Fix reverse-indexing bug in _vec.init_fn.Roy Frostig-3/+3
2010-08-04Add a buffered writer to stdlib _io module.Roy Frostig-2/+7
2010-08-03Address _vec.map allocation FIXME. Add test.Roy Frostig-6/+2
2010-08-03Address _vec.grow FIXME, as issue #89 has been closed.Roy Frostig-4/+1
2010-08-03Pass parametric types by-alias in various stdlib spots.Roy Frostig-2/+2
2010-07-27Switch machine-type lexemes to use suffixes. Remove support for foo(bar) as ↵Graydon Hoare-5/+5
a cast notation. Closes #129.
2010-07-22Notify copy glue of dst-initialization and fix _vec.alloc issues in lib and ↵Roy Frostig-2/+5
runtime. Closes #109.
2010-07-22Source FIXME annotations for issue #81 and a correction to STMT_bind fmt.Roy Frostig-5/+7
2010-07-15Implement the "simple typechecker", which avoids HM inferencePatrick Walton-1/+1
2010-07-16Add a _vec.slice function that'll hold us over until .(a,b) syntax isJeffrey Yasskin-0/+15
implemented. This could actually replace .(a,b) syntax if the language grows optional function parameters.
2010-07-13Add differently-typed refcount synonyms to _str and _vec.Graydon Hoare-0/+1
2010-07-05Uint-ify various bits of _str and _vec, enrich _vec a bit.Graydon Hoare-6/+36
2010-06-28The few and proud isolated bits from stdlib-work so far that don't break ↵Roy Frostig-0/+11
everything. Note util.rs hasn't yet been declared mod in the std crate. Don't do that yet, as it breaks make check.
2010-06-23Populate tree.Graydon Hoare-0/+30