aboutsummaryrefslogtreecommitdiff
path: root/src/comp/pretty
diff options
context:
space:
mode:
authorTim Chevalier <[email protected]>2011-03-24 12:12:04 -0700
committerGraydon Hoare <[email protected]>2011-04-01 11:27:32 -0700
commit3130348ee177f1716488b6caca6c7852fe47754c (patch)
treeee090db0203277e2adf4686fe26bbc3d3f024fbb /src/comp/pretty
parentrustc: Remove useless call to tag_variant_with_id() (diff)
downloadrust-3130348ee177f1716488b6caca6c7852fe47754c.tar.xz
rust-3130348ee177f1716488b6caca6c7852fe47754c.zip
Started adding support for typestate checking.
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.
Diffstat (limited to 'src/comp/pretty')
-rw-r--r--src/comp/pretty/pprust.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/comp/pretty/pprust.rs b/src/comp/pretty/pprust.rs
index f3b0f3fe..b0d6fb94 100644
--- a/src/comp/pretty/pprust.rs
+++ b/src/comp/pretty/pprust.rs
@@ -611,16 +611,16 @@ impure fn print_expr(ps s, &@ast.expr expr) {
case (ast.expr_path(?path,_,_)) {
print_path(s, path);
}
- case (ast.expr_fail) {
+ case (ast.expr_fail(_)) {
wrd(s.s, "fail");
}
- case (ast.expr_break) {
+ case (ast.expr_break(_)) {
wrd(s.s, "break");
}
- case (ast.expr_cont) {
+ case (ast.expr_cont(_)) {
wrd(s.s, "cont");
}
- case (ast.expr_ret(?result)) {
+ case (ast.expr_ret(?result,_)) {
wrd(s.s, "ret");
alt (result) {
case (option.some[@ast.expr](?expr)) {
@@ -630,7 +630,7 @@ impure fn print_expr(ps s, &@ast.expr expr) {
case (_) {}
}
}
- case (ast.expr_put(?result)) {
+ case (ast.expr_put(?result,_)) {
wrd(s.s, "put");
alt (result) {
case (option.some[@ast.expr](?expr)) {
@@ -640,15 +640,15 @@ impure fn print_expr(ps s, &@ast.expr expr) {
case (_) {}
}
}
- case (ast.expr_be(?result)) {
+ case (ast.expr_be(?result,_)) {
wrd1(s, "be");
print_expr(s, result);
}
- case (ast.expr_log(?expr)) {
+ case (ast.expr_log(?expr,_)) {
wrd1(s, "log");
print_expr(s, expr);
}
- case (ast.expr_check_expr(?expr)) {
+ case (ast.expr_check_expr(?expr,_)) {
wrd1(s, "check");
popen_h(s);
print_expr(s, expr);