aboutsummaryrefslogtreecommitdiff
path: root/src/lib/_vec.rs
Commit message (Collapse)AuthorAgeFilesLines
* Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke2011-05-121-0/+318
| | | | This should be a snapshot transition.
* Rename std modules to be camelcasedMarijn Haverbeke2011-05-061-318/+0
| | | | (Have fun mergining your stuff with this.)
* Remove 'deprecated mutable...' from our codeMarijn Haverbeke2011-05-051-4/+4
| | | | This should make compilation a bit less noisy.
* Un-revert "Use different syntax for checks that matter to typestate", fixing ↵Patrick Walton2011-05-021-5/+6
| | | | | | the problem. This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
* Revert "Use different syntax for checks that matter to typestate"Graydon Hoare2011-05-021-6/+5
| | | | This reverts commit aa25f22f197682de3b18fc4c8ba068d1feda220f. It broke stage2, not sure why yet.
* Use different syntax for checks that matter to typestateTim Chevalier2011-05-021-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.
* stdlib: Provide "array" as a friendlier shorthand for "vec[mutable? T]"Patrick Walton2011-04-281-17/+18
|
* Further work on typestate_checkTim Chevalier2011-04-281-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.
* stdlib/rt: Add an unsafe function to cast immutable vectors to mutable onesPatrick Walton2011-04-271-0/+2
|
* Handle nested items correctly in typestate_checkTim Chevalier2011-04-191-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
* Remove effect system from src.Graydon Hoare2011-04-191-1/+1
|
* stdlib: Add some vector functions: empty, empty_mut, grow_set, and freeze. ↵Patrick Walton2011-04-151-4/+31
| | | | Change _vec.grow to use uint arguments.
* Make expr_while work in typestate_checkTim Chevalier2011-04-131-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.)
* Continued sketching out code for checking states against preconditions.Tim Chevalier2011-04-061-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.
* Started adding support for typestate checking.Tim Chevalier2011-04-011-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.
* rustc: Open "use"d crates; add a _vec.vec_from_buf() method along the way; ↵Patrick Walton2011-03-241-1/+7
| | | | XFAIL use-import-export.rs in rustc
* Add a "last" function to return the last element of a vector to the standard ↵Patrick Walton2011-03-211-0/+12
| | | | library
* Add "mutable?" to _vec in the standard library; fix callersPatrick Walton2011-03-181-14/+15
|
* Add some mutable variants of vector functions to the standard libraryPatrick Walton2011-03-181-0/+25
|
* Switch all vases of vec += elt to vec += vec. Prohibit former in rustboot. ↵Graydon Hoare2011-03-161-16/+20
| | | | Tweak std lib vec fns in process.
* Remove redundant imports in lib (rustc doesn't like 'std' as a synonym for ↵Graydon Hoare2011-03-091-1/+0
| | | | root within std.rc anyway)
* Implement a map2() function in std._vecPatrick Walton2010-11-091-0/+18
|
* Support a special const-value refcount, use it for const strings.Graydon Hoare2010-11-091-2/+7
|
* Move the option type to its own modulePatrick Walton2010-11-051-2/+2
|
* Change vec slice to use uint, add push/pop/shift/unshift.Graydon Hoare2010-10-221-6/+29
|
* Reformat standard library; no code changes.Graydon Hoare2010-09-221-66/+75
|
* Test multi-ref'ed vec growth more seriously than before.Roy Frostig2010-09-031-0/+5
|
* Make _io.buf_reader read more than 0 bytes at a time.Roy Frostig2010-08-191-4/+20
|
* Address FIXME in _vec waiting on closed issue #108.Roy Frostig2010-08-121-5/+4
|
* Add vec debugging utility to _vec module.Roy Frostig2010-08-121-0/+5
|
* Fix reverse-indexing bug in _vec.init_fn.Roy Frostig2010-08-111-3/+3
|
* Add a buffered writer to stdlib _io module.Roy Frostig2010-08-041-2/+7
|
* Address _vec.map allocation FIXME. Add test.Roy Frostig2010-08-031-6/+2
|
* Address _vec.grow FIXME, as issue #89 has been closed.Roy Frostig2010-08-031-4/+1
|
* Pass parametric types by-alias in various stdlib spots.Roy Frostig2010-08-031-2/+2
|
* Switch machine-type lexemes to use suffixes. Remove support for foo(bar) as ↵Graydon Hoare2010-07-271-5/+5
| | | | a cast notation. Closes #129.
* Notify copy glue of dst-initialization and fix _vec.alloc issues in lib and ↵Roy Frostig2010-07-221-2/+5
| | | | runtime. Closes #109.
* Source FIXME annotations for issue #81 and a correction to STMT_bind fmt.Roy Frostig2010-07-221-5/+7
|
* Implement the "simple typechecker", which avoids HM inferencePatrick Walton2010-07-151-1/+1
|
* Add a _vec.slice function that'll hold us over until .(a,b) syntax isJeffrey Yasskin2010-07-161-0/+15
| | | | | implemented. This could actually replace .(a,b) syntax if the language grows optional function parameters.
* Add differently-typed refcount synonyms to _str and _vec.Graydon Hoare2010-07-131-0/+1
|
* Uint-ify various bits of _str and _vec, enrich _vec a bit.Graydon Hoare2010-07-051-6/+36
|
* The few and proud isolated bits from stdlib-work so far that don't break ↵Roy Frostig2010-06-281-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.
* Populate tree.Graydon Hoare2010-06-231-0/+30