Skip to content

Commit 776041d

Browse files
committed
---
yaml --- r: 31475 b: refs/heads/dist-snap c: eabd233 h: refs/heads/master i: 31473: 10d7a6e 31471: fe72d02 v: v3
1 parent 3f5b9f8 commit 776041d

File tree

7 files changed

+10
-77
lines changed

7 files changed

+10
-77
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 1d9f01cb421eae8e7ace0fa6b4d7f5ddf3ce4f65
10+
refs/heads/dist-snap: eabd233dcd208bc21ca0f8eea02d87d56e5314eb
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/libsyntax/ast.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ type matcher = spanned<matcher_>;
406406
// $foo:expr => 1 + $foo // interpolate an expr
407407
// $foo:tt => $foo // interpolate a token-tree
408408
// $foo:tt => bar! $foo // only other valid interpolation
409-
// // is in arg position for another macro
409+
// // is in arg position for another
410+
// // macro
410411
//
411412
// As a final, horrifying aside, note that macro-by-example's input is
412413
// also matched by one of these matchers. Holy self-referential! It is matched
@@ -441,11 +442,9 @@ type mac_body = option<mac_body_>;
441442

442443
#[auto_serialize]
443444
enum mac_ {
444-
mac_invoc(@path, mac_arg, mac_body),
445-
mac_invoc_tt(@path,~[token_tree]), // will kill mac_invoc and steal its name
446-
mac_embed_type(@ty), // obsolete quoter
447-
mac_embed_block(blk), // obsolete quoter
448-
mac_ellipsis, // obsolete pattern-match terminal
445+
mac_invoc(@path, mac_arg, mac_body), // old macro-invocation
446+
mac_invoc_tt(@path,~[token_tree]), // new macro-invocation
447+
mac_ellipsis, // old pattern-match (obsolete)
449448

450449
// the span is used by the quoter/anti-quoter ...
451450
mac_aq(span /* span of quote */, @expr), // anti-quote

branches/dist-snap/src/libsyntax/ext/simplext.rs

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ fn block_to_ident(blk: blk_) -> option<ident> {
539539
}
540540
}
541541

542-
fn p_t_s_r_mac(cx: ext_ctxt, mac: ast::mac, s: selector, b: binders) {
542+
fn p_t_s_r_mac(cx: ext_ctxt, mac: ast::mac, _s: selector, _b: binders) {
543543
fn select_pt_1(cx: ext_ctxt, m: matchable,
544544
fn_m: fn(ast::mac) -> match_result) -> match_result {
545545
ret alt m {
@@ -556,44 +556,6 @@ fn p_t_s_r_mac(cx: ext_ctxt, mac: ast::mac, s: selector, b: binders) {
556556
ast::mac_ellipsis { cx.span_fatal(mac.span, ~"misused `...`"); }
557557
ast::mac_invoc(_, _, _) { no_des(cx, mac.span, ~"macro calls"); }
558558
ast::mac_invoc_tt(_, _) { no_des(cx, mac.span, ~"macro calls"); }
559-
ast::mac_embed_type(ty) {
560-
alt ty.node {
561-
ast::ty_path(pth, _) {
562-
alt path_to_ident(pth) {
563-
some(id) {
564-
/* look for an embedded type */
565-
fn select_pt_2(m: ast::mac) -> match_result {
566-
ret alt m.node {
567-
ast::mac_embed_type(t) { some(leaf(match_ty(t))) }
568-
_ { none }
569-
}
570-
}
571-
let final_step = |x| select_pt_1(cx, x, select_pt_2);
572-
b.real_binders.insert(id, compose_sels(s, final_step));
573-
}
574-
none { no_des(cx, pth.span, ~"under `#<>`"); }
575-
}
576-
}
577-
_ { no_des(cx, ty.span, ~"under `#<>`"); }
578-
}
579-
}
580-
ast::mac_embed_block(blk) {
581-
alt block_to_ident(blk.node) {
582-
some(id) {
583-
fn select_pt_2(m: ast::mac) -> match_result {
584-
ret alt m.node {
585-
ast::mac_embed_block(blk) {
586-
some(leaf(match_block(blk)))
587-
}
588-
_ { none }
589-
}
590-
}
591-
let final_step = |x| select_pt_1(cx, x, select_pt_2);
592-
b.real_binders.insert(id, compose_sels(s, final_step));
593-
}
594-
none { no_des(cx, blk.span, ~"under `#{}`"); }
595-
}
596-
}
597559
ast::mac_aq(_,_) { no_des(cx, mac.span, ~"antiquotes"); }
598560
ast::mac_var(_) { no_des(cx, mac.span, ~"antiquote variables"); }
599561
}

branches/dist-snap/src/libsyntax/fold.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ fn fold_mac_(m: mac, fld: ast_fold) -> mac {
118118
option::map(arg, |x| fld.fold_expr(x)), body)
119119
}
120120
mac_invoc_tt(pth, tt) { m.node }
121-
mac_embed_type(ty) { mac_embed_type(fld.fold_ty(ty)) }
122-
mac_embed_block(blk) { mac_embed_block(fld.fold_block(blk)) }
123121
mac_ellipsis { mac_ellipsis }
124122
mac_aq(_,_) { /* FIXME (#2543) */ copy m.node }
125123
mac_var(_) { /* FIXME (#2543) */ copy m.node }

branches/dist-snap/src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import ast::{_mod, add, alt_check, alt_exhaustive, arg, arm, attribute,
3838
item_foreign_mod, item_impl, item_mac, item_mod, item_trait,
3939
item_ty, lit, lit_, lit_bool, lit_float, lit_int,
4040
lit_int_unsuffixed, lit_nil, lit_str, lit_uint, local, m_const,
41-
m_imm, m_mutbl, mac_, mac_aq, mac_ellipsis, mac_embed_block,
42-
mac_embed_type, mac_invoc, mac_invoc_tt, mac_var, matcher,
41+
m_imm, m_mutbl, mac_, mac_aq, mac_ellipsis,
42+
mac_invoc, mac_invoc_tt, mac_var, matcher,
4343
method, mode, mt, mtc_bb, mtc_rep, mtc_tok, mul, mutability, neg,
4444
noreturn, not, pat, pat_box, pat_enum, pat_ident, pat_lit,
4545
pat_range, pat_rec, pat_tup, pat_uniq, pat_wild, path, private,
@@ -831,21 +831,6 @@ class parser {
831831
|p| p.parse_expr());
832832
hi = self.span.hi;
833833
ex = expr_vec(es, mutbl);
834-
} else if self.token == token::POUND
835-
&& self.look_ahead(1u) == token::LT {
836-
self.bump(); self.bump();
837-
let ty = self.parse_ty(false);
838-
self.expect(token::GT);
839-
840-
/* hack: early return to take advantage of specialized function */
841-
ret pexpr(self.mk_mac_expr(lo, self.span.hi,
842-
mac_embed_type(ty)));
843-
} else if self.token == token::POUND
844-
&& self.look_ahead(1u) == token::LBRACE {
845-
self.bump(); self.bump();
846-
let blk = mac_embed_block(
847-
self.parse_block_tail(lo, default_blk));
848-
ret pexpr(self.mk_mac_expr(lo, self.span.hi, blk));
849834
} else if self.token == token::ELLIPSIS {
850835
self.bump();
851836
ret pexpr(self.mk_mac_expr(lo, self.span.hi, mac_ellipsis));

branches/dist-snap/src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ fn print_block_with_attrs(s: ps, blk: ast::blk, attrs: ~[ast::attribute]) {
728728
print_possibly_embedded_block_(s, blk, block_normal, indent_unit, attrs);
729729
}
730730
731-
enum embed_type { block_macro, block_block_fn, block_normal, }
731+
enum embed_type { block_block_fn, block_normal, }
732732
733733
fn print_possibly_embedded_block(s: ps, blk: ast::blk, embedded: embed_type,
734734
indented: uint) {
@@ -747,7 +747,6 @@ fn print_possibly_embedded_block_(s: ps, blk: ast::blk, embedded: embed_type,
747747
let ann_node = node_block(s, blk);
748748
s.ann.pre(ann_node);
749749
alt embedded {
750-
block_macro { word(s.s, ~"#{"); end(s); }
751750
block_block_fn { end(s); }
752751
block_normal { bopen(s); }
753752
}
@@ -841,14 +840,6 @@ fn print_mac(s: ps, m: ast::mac) {
841840
for tts.each() |tt| { print_tt(s, tt); }
842841
bclose(s, m.span);
843842
}
844-
ast::mac_embed_type(ty) {
845-
word(s.s, ~"#<");
846-
print_type(s, ty);
847-
word(s.s, ~">");
848-
}
849-
ast::mac_embed_block(blk) {
850-
print_possibly_embedded_block(s, blk, block_normal, indent_unit);
851-
}
852843
ast::mac_ellipsis { word(s.s, ~"..."); }
853844
ast::mac_var(v) { word(s.s, #fmt("$%u", v)); }
854845
_ { /* fixme */ }

branches/dist-snap/src/libsyntax/visit.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ fn visit_mac<E>(m: mac, e: E, v: vt<E>) {
351351
ast::mac_invoc(pth, arg, body) {
352352
option::map(arg, |arg| v.visit_expr(arg, e, v)); }
353353
ast::mac_invoc_tt(pth, tt) { /* no user-serviceable parts inside */ }
354-
ast::mac_embed_type(ty) { v.visit_ty(ty, e, v); }
355-
ast::mac_embed_block(blk) { v.visit_block(blk, e, v); }
356354
ast::mac_ellipsis { }
357355
ast::mac_aq(_, e) { /* FIXME: maybe visit (Issue #2340) */ }
358356
ast::mac_var(_) { }

0 commit comments

Comments
 (0)