about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorNick Desaulniers <ndesaulniers@mozilla.com>2013-01-31 17:51:01 -0800
committerBrian Anderson <banderson@mozilla.com>2013-01-31 20:12:49 -0800
commitaee79294699153ac7da9d2e5d076192c6eee3238 (patch)
tree18e14a0fcfddad87b2a2955e7821bb4c63acbbfa /src/libsyntax/parse
parent2db3175c76b51e5124cfa135de7ceeea8ceee0d6 (diff)
downloadrust-aee79294699153ac7da9d2e5d076192c6eee3238.tar.gz
rust-aee79294699153ac7da9d2e5d076192c6eee3238.zip
Replace most invocations of fail keyword with die! macro
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/comments.rs4
-rw-r--r--src/libsyntax/parse/lexer.rs2
-rw-r--r--src/libsyntax/parse/parser.rs4
-rw-r--r--src/libsyntax/parse/token.rs4
4 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index 26de85548e1..8ed10fb138d 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -117,7 +117,7 @@ pub fn strip_doc_comment_decoration(comment: ~str) -> ~str {
         return str::connect(lines, ~"\n");
     }
 
-    fail ~"not a doc-comment: " + comment;
+    die!(~"not a doc-comment: " + comment);
 }
 
 fn read_to_eol(rdr: string_reader) -> ~str {
@@ -295,7 +295,7 @@ fn consume_comment(rdr: string_reader, code_to_the_left: bool,
         read_block_comment(rdr, code_to_the_left, comments);
     } else if rdr.curr == '#' && nextch(rdr) == '!' {
         read_shebang_comment(rdr, code_to_the_left, comments);
-    } else { fail; }
+    } else { die!(); }
     debug!("<<< consume comment");
 }
 
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index c3b94182cc2..65fc86a106a 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -203,7 +203,7 @@ fn hex_digit_val(c: char) -> int {
     if in_range(c, '0', '9') { return (c as int) - ('0' as int); }
     if in_range(c, 'a', 'f') { return (c as int) - ('a' as int) + 10; }
     if in_range(c, 'A', 'F') { return (c as int) - ('A' as int) + 10; }
-    fail;
+    die!();
 }
 
 fn bin_digit_value(c: char) -> int { if c == '0' { return 0; } return 1; }
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 48f38092f88..51acf76ac30 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2500,7 +2500,7 @@ pub impl Parser {
                           _ => None
                         }
                       }
-                      _ => fail
+                      _ => die!()
                     };
 
                     match maybe_bound {
@@ -3892,7 +3892,7 @@ pub impl Parser {
             let metadata = self.parse_optional_meta();
             view_item_use(ident, metadata, self.get_id())
         } else {
-            fail;
+            die!();
         };
         self.expect(token::SEMI);
         @ast::view_item { node: node,
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 2093b5caebd..bcf4281132d 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -209,7 +209,7 @@ pub fn to_str(in: @ident_interner, t: Token) -> ~str {
                       nt_block(*) => ~"block",
                       nt_stmt(*) => ~"statement",
                       nt_pat(*) => ~"pattern",
-                      nt_expr(*) => fail ~"should have been handled above",
+                      nt_expr(*) => die!(~"should have been handled above"),
                       nt_ty(*) => ~"type",
                       nt_ident(*) => ~"identifier",
                       nt_path(*) => ~"path",
@@ -262,7 +262,7 @@ pub fn flip_delimiter(t: token::Token) -> token::Token {
       token::RPAREN => token::LPAREN,
       token::RBRACE => token::LBRACE,
       token::RBRACKET => token::LBRACKET,
-      _ => fail
+      _ => die!()
     }
 }