aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/ast.rs
diff options
context:
space:
mode:
authorTim Chevalier <[email protected]>2011-04-12 12:16:21 -0700
committerGraydon Hoare <[email protected]>2011-04-12 14:31:46 -0700
commitd7e881841438cfe0797b71ff35ea96c8f2477a76 (patch)
tree727e73ccf9138df34a1ad3585ef00559e526b2c6 /src/comp/front/ast.rs
parentAdd LLVMAddLoopIdiomPass. (diff)
downloadrust-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.rs6
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);
}