aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/ast.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use new module namespace syntax.Lindsey Kuper2011-05-131-2/+2
|
* Bug fixes.Lindsey Kuper2011-05-131-12/+0
| | | | | Fixed infinite loop on anonymous objects in parser; added expr_anon_obj to walk.rs; fixed syntax of test case.
* Correct capitalization of "Option".Lindsey Kuper2011-05-131-6/+6
|
* Starting on support for anonymous objects. Just syntax so far.Lindsey Kuper2011-05-131-0/+20
|
* Move capture checking into resolve.rsMarijn Haverbeke2011-05-131-2/+0
| | | | | Drops capture.rs. The new algorithm also checks for captures function arguments and obj fields.
* Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke2011-05-121-32/+31
| | | | This should be a snapshot transition.
* Keep resolve data in external hash table, rather than embedded defsMarijn Haverbeke2011-05-121-6/+12
| | | | | | | | | | | | | One step closer to removing fold and having a single, immutable AST. Resolve still uses fold, because it has to detect and transform expr_field expressions. If we go through on our plan of moving to a different syntax for module dereferencing, the parser can spit out expr_field expressions, and resolve can move to walk. (I am truly sorry for the things I did in typestate_check.rs. I expect we'll want to change that to walk as well in the near future, at which point it should probably pass around a context record, which could hold the def_map.)
* Ensure ann tags are actually kept around during typecheckingMarijn Haverbeke2011-05-121-1/+9
| | | | | | This way, the tag assigned by the parser stays with the node. I realize ann replacing is probably going away real soon, but I needed this now for moving the resolve defs out of the AST.
* Remove mod indices from the ASTMarijn Haverbeke2011-05-111-89/+2
| | | | | They are now created by the resolve pass, which is the only pass that needs them, and kept internal to that pass.
* Get rid of arm indicesMarijn Haverbeke2011-05-111-1/+1
|
* Get rid of block indicesMarijn Haverbeke2011-05-111-45/+12
|
* Use a const for crate-num-zero (ast.local_crate)Marijn Haverbeke2011-05-111-0/+1
|
* Rewrite comp/middle/resolve.rsMarijn Haverbeke2011-05-111-3/+3
| | | | | | | | | * Cleans up the algorithm * Move first pass to walk (second still folds) * Support part of a type/value namespace split (crate metadata and module indices still need to be taught about this) * Remove a few blatant inefficiencies (import tables being recreated for every lookup, most importantly)
* rustc: Number everything with an annotationPatrick Walton2011-05-101-1/+1
|
* Rename std modules to be camelcasedMarijn Haverbeke2011-05-061-27/+27
| | | | (Have fun mergining your stuff with this.)
* Bring back "pred" syntax for writing predicates for checkTim Chevalier2011-05-051-1/+7
| | | | | | | | | | This commit reinstates the requirement that the predicate in a "check" must be a manifest call to a special kind of function declared with the new "pred" keyword instead of "fn". Preds must have a boolean return type and can only call other preds; they can't have any effects (as enforced by the typechecker). The arguments to a predicate in a check expression must be slot variables or literals.
* Check well-formedness of constraintsTim Chevalier2011-05-051-0/+14
| | | | | | Check that the operand in a constraint is an explicit name, and that the operands are all local variables or literals. Still need to check that the name refers to a pure function.
* rustc: Stub support for Rust intrinsicsPatrick Walton2011-05-031-0/+1
|
* Extract ast.is_exported from the resolve moduleBrian Anderson2011-05-021-0/+22
|
* Un-revert "Use different syntax for checks that matter to typestate", fixing ↵Patrick Walton2011-05-021-1/+4
| | | | | | the problem. This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
* Revert "Use different syntax for checks that matter to typestate"Graydon Hoare2011-05-021-4/+1
| | | | This reverts commit aa25f22f197682de3b18fc4c8ba068d1feda220f. It broke stage2, not sure why yet.
* Use different syntax for checks that matter to typestateTim Chevalier2011-05-021-1/+4
| | | | | | | | | | 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.
* rustc: Switch @ty.t to ty.t so that we can change it to a uintPatrick Walton2011-04-221-2/+2
|
* Fix the signature of expr_extBrian Anderson2011-04-211-1/+1
| | | | The extension body is just a string, not an expression.
* Remove half-baked 'opacity' layer qualifier.Graydon Hoare2011-04-191-5/+0
|
* Remove effect system from src.Graydon Hoare2011-04-191-9/+6
|
* add log_err to rustcMarijn Haverbeke2011-04-191-1/+1
|
* Work on destructors, not entirely functional yet (no tydesc integration).Graydon Hoare2011-04-141-1/+1
|
* typestate_check can now handle expr_block, expr_if, and expr_binaryTim Chevalier2011-04-121-1/+2
| | | | | | | | | | | | | | | | (caveat for the latter: it assumes that binary operations are strict; a TODO is to detect or and and and correctly reflect that they're lazy in the second argument). I had to add an ann field to ast.block, resulting in the usual boilerplate changes. Test cases that currently work (if you uncomment the typestate pass in the driver) (all these are under test/compile-fail): fru-typestate ret-uninit use-uninit use-uninit-2 use-uninit-3
* rustc: Switch to indices for type parametersPatrick Walton2011-04-121-3/+3
|
* Further work on typestate. Handles expr_rec and expr_assign now.Tim Chevalier2011-04-121-2/+4
| | | | | | | | | | | | Also changed the ts_ann field on statements to be an ann instead, which explains most of the changes. As well, got rid of the "warning: no type for expression" error by filling in annotations for local decls in typeck (not sure whether this was my fault or not). Finally, in bitv, added a clone() function to copy a bit vector, and fixed is_true, is_false, and to_str to not be nonsense.
* Support for self-calls that take arguments.Lindsey Kuper2011-04-071-1/+1
| | | | | | | Nicer parsing of self-calls (expr_self_method nodes inside expr_call nodes, rather than a separate expr_call_self) makes typechecking tractable. We can now write self-calls that take arguments and return values (see: test/run-pass/obj-self-*.rs).
* Continued sketching out code for checking states against preconditions.Tim Chevalier2011-04-061-3/+3
| | | | | | | | | 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.
* Further on the path toward self-awareness.Lindsey Kuper2011-04-051-1/+1
| | | | | | | | | | | | | Mostly: * Merciless refactoring of trans.rs so that trans_call can work for self-calls as well as other kinds of calls Also: * Various changes to go with having idents, rather than exprs, in expr_call_self AST nodes * Added missing case for SELF token to token.to_str()
* Make box prefix operator and box type carry mutability flag.Graydon Hoare2011-04-041-2/+5
|
* Started adding support for typestate checking.Tim Chevalier2011-04-011-9/+12
| | | | | | | | | | | | | | | 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: Add a type annotation to tag itemsPatrick Walton2011-03-311-3/+3
|
* Improve line comment positioningMarijn Haverbeke2011-03-311-3/+4
| | | | This involved making ast.variant spanned.
* Add effect field to ast.ty_fn.Marijn Haverbeke2011-03-311-3/+2
| | | | Still not used, except by the pretty-printer.
* rustc: Thread an item-to-type mapping throughout the typechecking and ↵Patrick Walton2011-03-301-1/+3
| | | | translation phases
* Beginnings of support for magical self prefix; nothing profound happening yet.Lindsey Kuper2011-03-291-0/+1
|
* Teach trans to emit undefined references to 'use'd symbols. Can compile and ↵Graydon Hoare2011-03-291-0/+22
| | | | run a simple 'use std;' example now.
* Add expr_spawn, spawn parsing, folding, typechecking, ty_taskBrian Anderson2011-03-281-0/+6
|
* rustc: Add support for calling LLVM intrinsics as native functionsPatrick Walton2011-03-281-0/+1
|
* Add support for break and cont to rustcMarijn Haverbeke2011-03-271-0/+2
| | | | | Testing proper cleanup is hampered by https://github.com/graydon/rust/issues/293
* Another go at changing compile-command, this time using RBUILD env var.Graydon Hoare2011-03-251-1/+1
|
* Revert "Bulk-edit compile commands in emacs chatter to point to assumed ↵Graydon Hoare2011-03-251-1/+1
| | | | | | build/ dir off src root." This reverts commit 846f2e2ba994268725f38c36fa12f1a09f21615c.
* Bulk-edit compile commands in emacs chatter to point to assumed build/ dir ↵Graydon Hoare2011-03-251-1/+1
| | | | off src root.
* rustc: Store cached crate metadata in the sessionPatrick Walton2011-03-251-4/+1
|
* Refactor ast.local to make room for initialization via recvBrian Anderson2011-03-251-1/+9
|