diff options
| author | Brian Anderson <[email protected]> | 2011-02-27 22:35:27 -0500 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-02 10:28:15 -0800 |
| commit | c1e6f5328c3f46884ed7a7e29c780e307b02100a (patch) | |
| tree | 10ed869d28e3a9a4eb4a343151d6b1af7791b8d6 /src/comp/middle/fold.rs | |
| parent | Add pretty printing for expr_call, expr_path, and more literals (diff) | |
| download | rust-c1e6f5328c3f46884ed7a7e29c780e307b02100a.tar.xz rust-c1e6f5328c3f46884ed7a7e29c780e307b02100a.zip | |
Make the expanded expression in expr_ext not optional
Diffstat (limited to 'src/comp/middle/fold.rs')
| -rw-r--r-- | src/comp/middle/fold.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/comp/middle/fold.rs b/src/comp/middle/fold.rs index d533082c..c7041b26 100644 --- a/src/comp/middle/fold.rs +++ b/src/comp/middle/fold.rs @@ -157,7 +157,7 @@ type ast_fold[ENV] = (fn(&ENV e, &span sp, &path p, vec[@expr] args, option.t[@expr] body, - option.t[@expr] expanded, + @expr expanded, ann a) -> @expr) fold_expr_ext, (fn(&ENV e, &span sp) -> @expr) fold_expr_fail, @@ -653,10 +653,9 @@ fn fold_expr[ENV](&ENV env, ast_fold[ENV] fld, &@expr e) -> @expr { case (ast.expr_ext(?p, ?args, ?body, ?expanded, ?t)) { // Only fold the expanded expression, not the // expressions involved in syntax extension - auto exp = option.get[@expr](expanded); - auto exp_ = fold_expr(env_, fld, exp); + auto exp = fold_expr(env_, fld, expanded); ret fld.fold_expr_ext(env_, e.span, p, args, body, - some[@ast.expr](exp_), t); + exp, t); } case (ast.expr_fail) { @@ -1184,7 +1183,7 @@ fn identity_fold_expr_path[ENV](&ENV env, &span sp, fn identity_fold_expr_ext[ENV](&ENV env, &span sp, &path p, vec[@expr] args, option.t[@expr] body, - option.t[@expr] expanded, + @expr expanded, ann a) -> @expr { ret @respan(sp, ast.expr_ext(p, args, body, expanded, a)); } |