]> git.lizzy.rs Git - rust.git/commitdiff
Remove remaining use of 'pred' and make 'pred' a non-reserved word. Huzzah\!
authorTim Chevalier <chevalier@alum.wellesley.edu>
Fri, 26 Aug 2011 05:26:45 +0000 (22:26 -0700)
committerTim Chevalier <chevalier@alum.wellesley.edu>
Fri, 26 Aug 2011 05:26:45 +0000 (22:26 -0700)
src/comp/syntax/parse/parser.rs
src/lib/str.rs

index 10b1b01b44f60736ac05bbf22ea5dcb0d1df7a19..8ee2645fe5da18c8dc7a1752f0fb9560cb8cfcd3 100644 (file)
@@ -173,7 +173,6 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
     words.insert("fn", ());
     words.insert("block", ());
     words.insert("lambda", ());
-    words.insert("pred", ()); // FIXME: remove
     words.insert("pure", ());
     words.insert("iter", ());
     words.insert("block", ());
@@ -2135,11 +2134,6 @@ fn parse_item(p: &parser, attrs: &[ast::attribute]) -> option::t<@ast::item> {
         expect_word(p, "fn");
         ret some(parse_item_fn_or_iter(p, ast::pure_fn, ast::proto_fn, attrs,
                                        ast::il_normal));
-    }
-    // FIXME: remove
-    else if eat_word(p, "pred") {
-        ret some(parse_item_fn_or_iter(p, ast::pure_fn, ast::proto_fn, attrs,
-                                       ast::il_normal));
     } else if eat_word(p, "iter") {
         ret some(parse_item_fn_or_iter(p, ast::impure_fn, ast::proto_iter,
                                        attrs, ast::il_normal));
index 98e59f70b4f2b7ad8d5d8f4d6fa7aaabd3029c92..eff9e9bfd28ef88d82a8eff0406cc7628cb90c6c 100644 (file)
@@ -156,10 +156,10 @@ fn is_ascii(s: str) -> bool {
 fn alloc(n_bytes: uint) -> str { ret rustrt::str_alloc(n_bytes); }
 
 /// Returns true if the string has length 0
-pred is_empty(s: str) -> bool { for c: u8 in s { ret false; } ret true; }
+pure fn is_empty(s: str) -> bool { for c: u8 in s { ret false; } ret true; }
 
 /// Returns true if the string has length greater than 0
-pred is_not_empty(s: str) -> bool { !is_empty(s) }
+pure fn is_not_empty(s: str) -> bool { !is_empty(s) }
 
 fn is_whitespace(s: str) -> bool {
     let i = 0u;