self.pats_all(post.iter().map(|p| *p), vec_exit);
self.add_node(pat.id, [post_exit])
}
+
+ ast::PatMac(_) => {
+ self.tcx.sess.span_bug(pat.span, "unexpanded macro");
+ }
}
}
None => Some(vec(before.len() + after.len()))
}
}
+ PatMac(_) => cx.tcx.sess.bug("unexpanded macro"),
}
}
_ => None
}
}
+ PatMac(_) => {
+ cx.tcx.sess.span_err(pat_span, "unexpanded macro");
+ None
+ }
}
}
}
}
PatEnum(_,_) => {}
PatVec(..) => { this_pattern!() }
+ PatMac(_) => cx.tcx.sess.bug("unexpanded macro"),
}
}
ast::PatLit(_) | ast::PatRange(_, _) => {
/*always ok*/
}
+
+ ast::PatMac(_) => {
+ self.tcx().sess.span_bug(pat.span, "unexpanded macro");
+ }
}
Ok(())
bcx.sess().span_bug(pat.span,
"vector patterns are never irrefutable!");
}
+ ast::PatMac(..) => {
+ bcx.sess().span_bug(pat.span, "unexpanded macro");
+ }
ast::PatWild | ast::PatWildMulti | ast::PatLit(_) | ast::PatRange(_, _) => ()
}
return bcx;
walk_pattern(cx, sub_pat, scope_stack, scope_map);
}
}
+
+ ast::PatMac(_) => {
+ cx.sess().span_bug(pat.span, "debuginfo::populate_scope_map() - \
+ Found unexpanded macro.");
+ }
}
}
}
fcx.write_ty(pat.id, expected);
}
+
+ ast::PatMac(_) => tcx.sess.bug("unexpanded macro"),
}
}
PatRange(..) => fail!("tried to get argument name from PatRange, \
which is not allowed in function arguments"),
PatVec(..) => fail!("tried to get argument name from pat_vec, \
- which is not allowed in function arguments")
+ which is not allowed in function arguments"),
+ PatMac(..) => {
+ warn!("can't document the name of a function argument \
+ produced by a pattern macro");
+ "(argument produced by macro)".to_string()
+ }
}
}
PatRange(@Expr, @Expr),
// [a, b, ..i, y, z] is represented as
// PatVec(~[a, b], Some(i), ~[y, z])
- PatVec(Vec<@Pat> , Option<@Pat>, Vec<@Pat> )
+ PatVec(Vec<@Pat> , Option<@Pat>, Vec<@Pat> ),
+ PatMac(Mac),
}
#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash, Show)]
slice.iter().advance(|&p| walk_pat(p, |p| it(p))) &&
after.iter().advance(|&p| walk_pat(p, |p| it(p)))
}
+ PatMac(_) => fail!("attempted to analyze unexpanded pattern"),
PatWild | PatWildMulti | PatLit(_) | PatRange(_, _) | PatIdent(_, _, _) |
PatEnum(_, _) => {
true
slice.map(|x| folder.fold_pat(x)),
after.iter().map(|x| folder.fold_pat(*x)).collect())
}
+ PatMac(ref mac) => PatMac(folder.fold_mac(mac)),
};
@Pat {
|s, &p| s.print_pat(p)));
try!(word(&mut self.s, "]"));
}
+ ast::PatMac(ref m) => try!(self.print_mac(m)),
}
self.ann.post(self, NodePat(pat))
}
visitor.visit_pat(*postpattern, env.clone())
}
}
+ PatMac(ref macro) => visitor.visit_mac(macro, env),
}
}