Skip to content

Commit f14fa8e

Browse files
brsongraydon
authored andcommitted
---
yaml --- r: 1472 b: refs/heads/master c: 5e06ec9 h: refs/heads/master v: v3
1 parent 916d26d commit f14fa8e

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fe5de6bfffee3c277f540517b5766547f34e81c7
2+
refs/heads/master: 5e06ec977f4446a7b19a09dd3a3781bcf26f8442

trunk/src/comp/front/parser.rs

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,8 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr {
656656
some(token.COMMA),
657657
pf, p);
658658
hi = es.span;
659-
ex = ast.expr_ext(pth, es.node, none[@ast.expr],
660-
none[@ast.expr], ast.ann_none);
661-
// FIXME: Here is probably not the right place for this
662-
ex = expand_syntax_ext(p, @spanned(lo, hi, ex)).node;
659+
ex = expand_syntax_ext(p, es.span, pth, es.node,
660+
none[@ast.expr]);
663661
}
664662

665663
case (token.FAIL) {
@@ -748,24 +746,23 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr {
748746
* rust crates. At the moment we have neither.
749747
*/
750748

751-
impure fn expand_syntax_ext(parser p, @ast.expr ext) -> @ast.expr {
752-
check (ast.is_ext_expr(ext));
753-
alt (ext.node) {
754-
case (ast.expr_ext(?path, ?args, ?body, _, ?ann)) {
755-
check (_vec.len[ast.ident](path.node.idents) > 0u);
756-
auto extname = path.node.idents.(0);
757-
if (_str.eq(extname, "fmt")) {
758-
auto expanded = extfmt.expand_syntax_ext(args, body);
759-
auto newexpr = ast.expr_ext(path, args, body,
760-
some[@ast.expr](expanded), ann);
761-
762-
ret @spanned(ext.span, ext.span, newexpr);
763-
} else {
764-
p.err("unknown syntax extension");
765-
}
766-
}
749+
impure fn expand_syntax_ext(parser p, ast.span sp,
750+
&ast.path path, vec[@ast.expr] args,
751+
option.t[@ast.expr] body) -> ast.expr_ {
752+
753+
check (_vec.len[ast.ident](path.node.idents) > 0u);
754+
auto extname = path.node.idents.(0);
755+
if (_str.eq(extname, "fmt")) {
756+
auto expanded = extfmt.expand_syntax_ext(args, body);
757+
auto newexpr = ast.expr_ext(path, args, body,
758+
some[@ast.expr](expanded),
759+
ast.ann_none);
760+
761+
ret newexpr;
762+
} else {
763+
p.err("unknown syntax extension");
764+
fail;
767765
}
768-
fail;
769766
}
770767

771768
impure fn extend_expr_by_ident(parser p, span lo, span hi,

0 commit comments

Comments
 (0)