diff options
| author | Nick Desaulniers <ndesaulniers@mozilla.com> | 2013-01-31 17:51:01 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-01-31 20:12:49 -0800 |
| commit | aee79294699153ac7da9d2e5d076192c6eee3238 (patch) | |
| tree | 18e14a0fcfddad87b2a2955e7821bb4c63acbbfa /src/libsyntax/ext | |
| parent | 2db3175c76b51e5124cfa135de7ceeea8ceee0d6 (diff) | |
Replace most invocations of fail keyword with die! macro
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/parse_proto.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 6 |
4 files changed, 15 insertions, 15 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index a2484e2d6df..e406e09aac0 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -812,8 +812,8 @@ fn mk_struct_fields(fields: ~[@ast::struct_field]) -> ~[field] { do fields.map |field| { let (ident, mutbl) = match field.node.kind { ast::named_field(ident, mutbl, _) => (ident, mutbl), - _ => fail ~"[auto_encode] does not support \ - unnamed fields", + _ => die!(~"[auto_encode] does not support \ + unnamed fields") }; field { @@ -954,9 +954,9 @@ fn mk_enum_ser_body( ast::tuple_variant_kind(args) => ser_variant(cx, span, variant.node.name, v_idx, args), ast::struct_variant_kind(*) => - fail ~"struct variants unimplemented", + die!(~"struct variants unimplemented"), ast::enum_variant_kind(*) => - fail ~"enum variants unimplemented", + die!(~"enum variants unimplemented"), } }; @@ -1047,9 +1047,9 @@ fn mk_enum_deser_body( } }, ast::struct_variant_kind(*) => - fail ~"struct variants unimplemented", + die!(~"struct variants unimplemented"), ast::enum_variant_kind(*) => - fail ~"enum variants unimplemented", + die!(~"enum variants unimplemented") }; let pat = @ast::pat { diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs index a74214c8758..1502332859c 100644 --- a/src/libsyntax/ext/pipes/parse_proto.rs +++ b/src/libsyntax/ext/pipes/parse_proto.rs @@ -40,13 +40,13 @@ pub impl parser::Parser: proto_parser { self.expect(token::COLON); let dir = match copy self.token { token::IDENT(n, _) => self.interner.get(n), - _ => fail + _ => die!() }; self.bump(); let dir = match dir { @~"send" => send, @~"recv" => recv, - _ => fail + _ => die!() }; let typarms = if self.token == token::LT { diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 7605e01fbf0..4a9a22de50f 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -184,7 +184,7 @@ pub mod rt { Some(ast) => ast, None => { error!("Parse error with ```\n%s\n```", s); - fail + die!() } } } @@ -399,7 +399,7 @@ fn mk_token(cx: ext_ctxt, sp: span, tok: token::Token) -> @ast::expr { ~[mk_ident(cx, sp, ident)]); } - INTERPOLATED(_) => fail ~"quote! with interpolated token", + INTERPOLATED(_) => die!(~"quote! with interpolated token"), _ => () } @@ -437,7 +437,7 @@ fn mk_token(cx: ext_ctxt, sp: span, tok: token::Token) -> @ast::expr { DOLLAR => "DOLLAR", UNDERSCORE => "UNDERSCORE", EOF => "EOF", - _ => fail + _ => die!() }; build::mk_path(cx, sp, ids_ext(cx, ~[name.to_owned()])) @@ -467,7 +467,7 @@ fn mk_tt(cx: ext_ctxt, sp: span, tt: &ast::token_tree) } ast::tt_delim(ref tts) => mk_tts(cx, sp, *tts), - ast::tt_seq(*) => fail ~"tt_seq in quote!", + ast::tt_seq(*) => die!(~"tt_seq in quote!"), ast::tt_nonterminal(sp, ident) => { diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 4c0550b3c3a..1c7a12a4282 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -125,7 +125,7 @@ pub type matcher_pos = ~{ pub fn copy_up(&& mpu: matcher_pos_up) -> matcher_pos { match &mpu { &matcher_pos_up(Some(ref mp)) => copy (*mp), - _ => fail + _ => die!() } } @@ -362,7 +362,7 @@ pub fn parse(sess: parse_sess, fmt!("%s ('%s')", *sess.interner.get(name), *sess.interner.get(bind)) } - _ => fail + _ => die!() } }), ~" or "); return error(sp, fmt!( "Local ambiguity: multiple parsing options: \ @@ -387,7 +387,7 @@ pub fn parse(sess: parse_sess, parse_nt(rust_parser, *sess.interner.get(name)))); ei.idx += 1u; } - _ => fail + _ => die!() } cur_eis.push(move ei); |
