Keep resolve data in external hash table, rather than embedded defs

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.)
This commit is contained in:
Marijn Haverbeke 2011-05-12 13:25:18 +02:00
parent 2b36e40c58
commit 358a1aeec9
14 changed files with 521 additions and 486 deletions

View file

@ -613,7 +613,7 @@ fn print_expr(ps s, &@ast.expr expr) {
print_expr(s, index);
pclose(s);
}
case (ast.expr_path(?path,_,_)) {
case (ast.expr_path(?path,_)) {
print_path(s, path);
}
case (ast.expr_fail(_)) {
@ -768,7 +768,7 @@ fn print_pat(ps s, &@ast.pat pat) {
case (ast.pat_wild(_)) {wrd(s.s, "_");}
case (ast.pat_bind(?id,_,_)) {wrd(s.s, "?" + id);}
case (ast.pat_lit(?lit,_)) {print_literal(s, lit);}
case (ast.pat_tag(?path,?args,_,_)) {
case (ast.pat_tag(?path,?args,_)) {
print_path(s, path);
if (Vec.len[@ast.pat](args) > 0u) {
popen_h(s);