1
Fork 0

Fix the signature of expr_ext

The extension body is just a string, not an expression.
This commit is contained in:
Brian Anderson 2011-04-21 20:34:04 -04:00
parent c78b73b71d
commit 540344acb9
5 changed files with 8 additions and 8 deletions

View file

@ -275,7 +275,7 @@ tag expr_ {
expr_field(@expr, ident, ann); expr_field(@expr, ident, ann);
expr_index(@expr, @expr, ann); expr_index(@expr, @expr, ann);
expr_path(path, option.t[def], ann); expr_path(path, option.t[def], ann);
expr_ext(path, vec[@expr], option.t[@expr], @expr, ann); expr_ext(path, vec[@expr], option.t[str], @expr, ann);
expr_fail(ann); expr_fail(ann);
expr_break(ann); expr_break(ann);
expr_cont(ann); expr_cont(ann);

View file

@ -46,7 +46,7 @@ export expand_syntax_ext;
// FIXME: Need to thread parser through here to handle errors correctly // FIXME: Need to thread parser through here to handle errors correctly
fn expand_syntax_ext(vec[@ast.expr] args, fn expand_syntax_ext(vec[@ast.expr] args,
option.t[@ast.expr] body) -> @ast.expr { option.t[str] body) -> @ast.expr {
if (_vec.len[@ast.expr](args) == 0u) { if (_vec.len[@ast.expr](args) == 0u) {
log_err "malformed #fmt call"; log_err "malformed #fmt call";

View file

@ -794,7 +794,7 @@ fn parse_bottom_expr(parser p) -> @ast.expr {
pf, p); pf, p);
hi = es.span.hi; hi = es.span.hi;
ex = expand_syntax_ext(p, es.span, pth, es.node, ex = expand_syntax_ext(p, es.span, pth, es.node,
none[@ast.expr]); none[str]);
} }
case (token.FAIL) { case (token.FAIL) {
@ -935,7 +935,7 @@ fn parse_bottom_expr(parser p) -> @ast.expr {
fn expand_syntax_ext(parser p, ast.span sp, fn expand_syntax_ext(parser p, ast.span sp,
&ast.path path, vec[@ast.expr] args, &ast.path path, vec[@ast.expr] args,
option.t[@ast.expr] body) -> ast.expr_ { option.t[str] body) -> ast.expr_ {
check (_vec.len[ast.ident](path.node.idents) > 0u); check (_vec.len[ast.ident](path.node.idents) > 0u);
auto extname = path.node.idents.(0); auto extname = path.node.idents.(0);

View file

@ -173,7 +173,7 @@ type ast_fold[ENV] =
(fn(&ENV e, &span sp, (fn(&ENV e, &span sp,
&path p, vec[@expr] args, &path p, vec[@expr] args,
option.t[@expr] body, option.t[str] body,
@expr expanded, @expr expanded,
ann a) -> @expr) fold_expr_ext, ann a) -> @expr) fold_expr_ext,
@ -1343,7 +1343,7 @@ fn identity_fold_expr_path[ENV](&ENV env, &span sp,
fn identity_fold_expr_ext[ENV](&ENV env, &span sp, fn identity_fold_expr_ext[ENV](&ENV env, &span sp,
&path p, vec[@expr] args, &path p, vec[@expr] args,
option.t[@expr] body, option.t[str] body,
@expr expanded, @expr expanded,
ann a) -> @expr { ann a) -> @expr {
ret @respan(sp, ast.expr_ext(p, args, body, expanded, a)); ret @respan(sp, ast.expr_ext(p, args, body, expanded, a));

View file

@ -1922,9 +1922,9 @@ fn annotate_expr(&fn_info_map fm, &@expr e) -> @expr {
case (expr_path(_,_,_)) { case (expr_path(_,_,_)) {
/* no change */ /* no change */
} }
case (expr_ext(?p, ?es, ?e_opt, ?e, ?a)) { case (expr_ext(?p, ?es, ?s_opt, ?e, ?a)) {
e1 = expr_ext(p, annotate_exprs(fm, es), e1 = expr_ext(p, annotate_exprs(fm, es),
annotate_option_exp(fm, e_opt), s_opt,
annotate_expr(fm, e), a); annotate_expr(fm, e), a);
} }
/* no change, next 3 cases */ /* no change, next 3 cases */