Skip to content

Commit b099760

Browse files
committed
Remove remaining use of 'pred' and make 'pred' a non-reserved word. Huzzah\!
1 parent 63f9b43 commit b099760

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/comp/syntax/parse/parser.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
173173
words.insert("fn", ());
174174
words.insert("block", ());
175175
words.insert("lambda", ());
176-
words.insert("pred", ()); // FIXME: remove
177176
words.insert("pure", ());
178177
words.insert("iter", ());
179178
words.insert("block", ());
@@ -2135,11 +2134,6 @@ fn parse_item(p: &parser, attrs: &[ast::attribute]) -> option::t<@ast::item> {
21352134
expect_word(p, "fn");
21362135
ret some(parse_item_fn_or_iter(p, ast::pure_fn, ast::proto_fn, attrs,
21372136
ast::il_normal));
2138-
}
2139-
// FIXME: remove
2140-
else if eat_word(p, "pred") {
2141-
ret some(parse_item_fn_or_iter(p, ast::pure_fn, ast::proto_fn, attrs,
2142-
ast::il_normal));
21432137
} else if eat_word(p, "iter") {
21442138
ret some(parse_item_fn_or_iter(p, ast::impure_fn, ast::proto_iter,
21452139
attrs, ast::il_normal));

src/lib/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ fn is_ascii(s: str) -> bool {
156156
fn alloc(n_bytes: uint) -> str { ret rustrt::str_alloc(n_bytes); }
157157

158158
/// Returns true if the string has length 0
159-
pred is_empty(s: str) -> bool { for c: u8 in s { ret false; } ret true; }
159+
pure fn is_empty(s: str) -> bool { for c: u8 in s { ret false; } ret true; }
160160

161161
/// Returns true if the string has length greater than 0
162-
pred is_not_empty(s: str) -> bool { !is_empty(s) }
162+
pure fn is_not_empty(s: str) -> bool { !is_empty(s) }
163163

164164
fn is_whitespace(s: str) -> bool {
165165
let i = 0u;

0 commit comments

Comments
 (0)