Add optional message to fail.

This commit is contained in:
Josh Matthews 2011-06-08 03:58:52 -04:00
parent b5c73605ea
commit 2235fb73ef
10 changed files with 41 additions and 13 deletions

View file

@ -825,8 +825,13 @@ fn print_expr(&ps s, &@ast::expr expr) {
case (ast::expr_path(?path,_)) {
print_path(s, path);
}
case (ast::expr_fail(_)) {
case (ast::expr_fail(_, ?str)) {
word(s.s, "fail");
alt (str) {
case (some(?msg)) {
word(s.s, #fmt("\"%s\"", msg));
}
}
}
case (ast::expr_break(_)) {
word(s.s, "break");