Convert alt to match. Stop parsing alt

This commit is contained in:
Brian Anderson 2012-08-06 12:34:08 -07:00
parent d3a9bb1bd4
commit ecaf9e39c9
359 changed files with 2938 additions and 2915 deletions

View file

@ -82,9 +82,9 @@ fn fold_foreign_mod(cx: ctxt, nm: ast::foreign_mod,
fn filter_stmt(cx: ctxt, &&stmt: @ast::stmt) ->
option<@ast::stmt> {
alt stmt.node {
match stmt.node {
ast::stmt_decl(decl, _) => {
alt decl.node {
match decl.node {
ast::decl_item(item) => {
if item_in_cfg(cx, item) {
option::some(stmt)

View file

@ -15,7 +15,7 @@ fn inject_intrinsic(sess: session,
~[],
sess.parse_sess);
let item =
alt item {
match item {
some(i) => i,
none => {
sess.fatal(~"no item found in intrinsic module");

View file

@ -70,7 +70,7 @@ fn fold_mod(_cx: test_ctxt, m: ast::_mod, fld: fold::ast_fold) -> ast::_mod {
// FIXME (#2403): This is sloppy. Instead we should have some mechanism to
// indicate to the translation pass which function we want to be main.
fn nomain(&&item: @ast::item) -> option<@ast::item> {
alt item.node {
match item.node {
ast::item_fn(_, _, _) => {
if *item.ident == ~"main" {
option::none
@ -102,7 +102,7 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
debug!{"current path: %s", ast_util::path_name_i(cx.path)};
if is_test_fn(i) {
alt i.node {
match i.node {
ast::item_fn(decl, _, _) if decl.purity == ast::unsafe_fn => {
cx.sess.span_fatal(
i.span,
@ -129,7 +129,7 @@ fn is_test_fn(i: @ast::item) -> bool {
vec::len(attr::find_attrs_by_name(i.attrs, ~"test")) > 0u;
fn has_test_signature(i: @ast::item) -> bool {
alt i.node {
match i.node {
ast::item_fn(decl, tps, _) => {
let input_cnt = vec::len(decl.inputs);
let no_output = decl.output.node == ast::ty_nil;
@ -246,7 +246,7 @@ fn mk_path(cx: test_ctxt, path: ~[ast::ident]) -> ~[ast::ident] {
// the paths with std::
let is_std = {
let items = attr::find_linkage_metas(cx.crate.node.attrs);
alt attr::last_meta_item_value_str_by_name(items, ~"name") {
match attr::last_meta_item_value_str_by_name(items, ~"name") {
some(@~"std") => true,
_ => false
}