diff options
| author | Tim Chevalier <[email protected]> | 2011-04-12 12:16:21 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-04-12 14:31:46 -0700 |
| commit | d7e881841438cfe0797b71ff35ea96c8f2477a76 (patch) | |
| tree | 727e73ccf9138df34a1ad3585ef00559e526b2c6 /src/comp/front/ast.rs | |
| parent | Add LLVMAddLoopIdiomPass. (diff) | |
| download | rust-d7e881841438cfe0797b71ff35ea96c8f2477a76.tar.xz rust-d7e881841438cfe0797b71ff35ea96c8f2477a76.zip | |
Further work on typestate. Handles expr_rec and expr_assign now.
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.
Diffstat (limited to 'src/comp/front/ast.rs')
| -rw-r--r-- | src/comp/front/ast.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 4f7a2538..50517f00 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -215,8 +215,10 @@ tag mode { type stmt = spanned[stmt_]; tag stmt_ { - stmt_decl(@decl, option.t[@ts_ann]); - stmt_expr(@expr, option.t[@ts_ann]); +/* Only the ts_ann field is meaningful for statements, + but we make it an ann to make traversals simpler */ + stmt_decl(@decl, ann); + stmt_expr(@expr, ann); // These only exist in crate-level blocks. stmt_crate_directive(@crate_directive); } |