Remove fail keyword from lexer & parser and clean up remaining calls to

fail

Fix merge conflicts - Issue 4524
This commit is contained in:
Nick Desaulniers 2013-01-31 18:24:09 -08:00
parent 6fb4239bb3
commit 7868b6bf55
37 changed files with 109 additions and 145 deletions

View file

@ -63,7 +63,7 @@ fn show_digit(nn: uint) -> ~str {
7 => {~"seven"}
8 => {~"eight"}
9 => {~"nine"}
_ => {fail ~"expected digits from 0 to 9..."}
_ => {die!(~"expected digits from 0 to 9...")}
}
}

View file

@ -4,7 +4,7 @@ fn a() {
[~ref _a] => {
vec[0] = ~4; //~ ERROR prohibited due to outstanding loan
}
_ => fail ~"foo"
_ => die!(~"foo")
}
}

View file

@ -9,8 +9,8 @@
// except according to those terms.
fn main() {
for vec::each(fail) |i| {
for vec::each(die!()) |i| {
log (debug, i * 2);
//~^ ERROR the type of this value must be known
};
}
}

View file

@ -2,7 +2,7 @@
// they occur as part of various kinds of expressions.
struct Foo<A> { f: A }
fn guard(_s: ~str) -> bool {fail}
fn guard(_s: ~str) -> bool {die!()}
fn touch<A>(_a: &A) {}
fn f10() {
@ -92,4 +92,4 @@ fn f120() {
touch(&x[1]);
}
fn main() {}
fn main() {}

View file

@ -11,4 +11,4 @@
// error-pattern:woe
fn f(a: int) { log(debug, a); }
fn main() { f(fail ~"woe"); }
fn main() { f(die!(~"woe")); }

View file

@ -8,13 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Fail statements without arguments need to be disambiguated in
// Fail macros without arguments need to be disambiguated in
// certain positions
// error-pattern:oops
fn bigfail() {
while (fail ~"oops") { if (fail) {
match (fail) { () => {
while (die!(~"oops")) { if (die!()) {
match (die!()) { () => {
}
}
}};

View file

@ -10,5 +10,5 @@
// error-pattern:roflcopter
fn main() {
log (fail ~"roflcopter", 2);
log (die!(~"roflcopter"), 2);
}

View file

@ -15,7 +15,7 @@ use std::arc;
enum e<T> { e(arc::ARC<T>) }
fn foo() -> e<int> {fail;}
fn foo() -> e<int> {die!();}
fn main() {
let f = foo();

View file

@ -14,5 +14,5 @@ struct Point { x: int, y: int }
fn main() {
let origin = Point {x: 0, y: 0};
let f: Point = Point {x: (fail ~"beep boop"),.. origin};
let f: Point = Point {x: (die!(~"beep boop")),.. origin};
}

View file

@ -9,4 +9,4 @@
// except according to those terms.
// error-pattern: fail
fn main() { ~fail; }
fn main() { ~die!(); }

View file

@ -54,21 +54,21 @@ fn get_v5(a: &v/A, i: uint) -> &v/int {
fn get_v6_a(a: &v/A, i: uint) -> &v/int {
match a.value.v6 {
Some(ref v) => &v.f,
None => fail
None => die!()
}
}
fn get_v6_b(a: &v/A, i: uint) -> &v/int {
match *a {
A { value: B { v6: Some(ref v), _ } } => &v.f,
_ => fail
_ => die!()
}
}
fn get_v6_c(a: &v/A, i: uint) -> &v/int {
match a {
&A { value: B { v6: Some(ref v), _ } } => &v.f,
_ => fail
_ => die!()
}
}