diff options
| author | bors <bors@rust-lang.org> | 2013-03-29 16:42:43 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-03-29 16:42:43 -0700 |
| commit | f864934f548be9f03d2c0512de8d7e908469e2ae (patch) | |
| tree | 8199ebdfbabc8b0a537f7b9330716e3b9c71714a /src/libsyntax/parse | |
| parent | a17a9d41f6bf06daacb0aedb0cb2144dc4ba1c53 (diff) | |
| parent | 1e91595520d0538e6003dc9186f1b0df5c25b77a (diff) | |
| download | rust-f864934f548be9f03d2c0512de8d7e908469e2ae.tar.gz rust-f864934f548be9f03d2c0512de8d7e908469e2ae.zip | |
auto merge of #5628 : brson/rust/assert, r=brson
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 12 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 0804951327a..f90ff21cdf0 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -48,7 +48,7 @@ pub fn is_doc_comment(s: &str) -> bool { } pub fn doc_comment_style(comment: &str) -> ast::attr_style { - fail_unless!(is_doc_comment(comment)); + assert!(is_doc_comment(comment)); if comment.starts_with(~"//!") || comment.starts_with(~"/*!") { ast::attr_inner } else { @@ -134,7 +134,7 @@ fn read_to_eol(rdr: @mut StringReader) -> ~str { fn read_one_line_comment(rdr: @mut StringReader) -> ~str { let val = read_to_eol(rdr); - fail_unless!((val[0] == '/' as u8 && val[1] == '/' as u8) || + assert!((val[0] == '/' as u8 && val[1] == '/' as u8) || (val[0] == '#' as u8 && val[1] == '!' as u8)); return val; } @@ -247,7 +247,7 @@ fn read_block_comment(rdr: @mut StringReader, bump(rdr); } if !is_block_non_doc_comment(curr_line) { return; } - fail_unless!(!curr_line.contains_char('\n')); + assert!(!curr_line.contains_char('\n')); lines.push(curr_line); } else { let mut level: int = 1; diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index ffd2a1d801c..17d6ba3ac93 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -187,7 +187,7 @@ pub fn bump(rdr: @mut StringReader) { rdr.last_pos = rdr.pos; let current_byte_offset = byte_offset(rdr).to_uint();; if current_byte_offset < (*rdr.src).len() { - fail_unless!(rdr.curr != -1 as char); + assert!(rdr.curr != -1 as char); let last_char = rdr.curr; let next = str::char_range_at(*rdr.src, current_byte_offset); let byte_offset_diff = next.next - current_byte_offset; @@ -314,7 +314,7 @@ fn consume_any_line_comment(rdr: @mut StringReader) } pub fn is_block_non_doc_comment(s: &str) -> bool { - fail_unless!(s.len() >= 1u); + assert!(s.len() >= 1u); str::all_between(s, 1u, s.len() - 1u, |ch| ch == '*') } diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index cdb67129c35..22e659fa574 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -214,7 +214,7 @@ pub fn next_node_id(sess: @mut ParseSess) -> node_id { let rv = sess.next_id; sess.next_id += 1; // ID 0 is reserved for the crate and doesn't actually exist in the AST - fail_unless!(rv != 0); + assert!(rv != 0); return rv; } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d93e5995d4f..ac0e42fc65d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2529,7 +2529,7 @@ pub impl Parser { fn parse_block(&self) -> blk { let (attrs, blk) = self.parse_inner_attrs_and_block(false); - fail_unless!(vec::is_empty(attrs)); + assert!(vec::is_empty(attrs)); return blk; } @@ -3922,7 +3922,7 @@ pub impl Parser { foreign_items_allowed: bool, macros_allowed: bool ) -> item_or_view_item { - fail_unless!(items_allowed != foreign_items_allowed); + assert!(items_allowed != foreign_items_allowed); maybe_whole!(iovi self, nt_item); let lo = self.span.lo; @@ -4333,13 +4333,13 @@ pub impl Parser { view_items.push(view_item); } iovi_item(item) => { - fail_unless!(items_allowed); + assert!(items_allowed); items.push(item); attrs = self.parse_outer_attributes(); break; } iovi_foreign_item(foreign_item) => { - fail_unless!(foreign_items_allowed); + assert!(foreign_items_allowed); foreign_items.push(foreign_item); attrs = self.parse_outer_attributes(); break; @@ -4364,11 +4364,11 @@ pub impl Parser { view_items.push(view_item); } iovi_item(item) => { - fail_unless!(items_allowed); + assert!(items_allowed); items.push(item) } iovi_foreign_item(foreign_item) => { - fail_unless!(foreign_items_allowed); + assert!(foreign_items_allowed); foreign_items.push(foreign_item); } } |
