From d7e881841438cfe0797b71ff35ea96c8f2477a76 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Tue, 12 Apr 2011 12:16:21 -0700 Subject: 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. --- src/comp/front/ast.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/comp/front/ast.rs') 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); } -- cgit v1.2.3