Skip to content

Commit 626b64f

Browse files
committed
---
yaml --- r: 4922 b: refs/heads/master c: c6155d1 h: refs/heads/master v: v3
1 parent 844fb5a commit 626b64f

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 5b5689d4ddbc75c34c5c9c70fdbc27b351a7a2f4
2+
refs/heads/master: c6155d1fd112407c2d111c0c81c38a3606a0954e

trunk/src/comp/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ fn item_family_to_str(fam: u8) -> str {
284284
alt fam as char {
285285
'c' { ret "const"; }
286286
'f' { ret "fn"; }
287-
'p' { ret "pred"; }
287+
'p' { ret "pure fn"; }
288288
'F' { ret "native fn"; }
289289
'y' { ret "type"; }
290290
'T' { ret "native type"; }

trunk/src/comp/syntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ type fn_decl =
371371
constraints: [@constr]};
372372

373373
tag purity {
374-
pure_fn; // declared with "pred"
374+
pure_fn; // declared with "pure fn"
375375
impure_fn; // declared with "fn"
376376
}
377377

trunk/src/comp/syntax/parse/parser.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
173173
words.insert("fn", ());
174174
words.insert("block", ());
175175
words.insert("lambda", ());
176-
words.insert("pred", ());
176+
words.insert("pure", ());
177177
words.insert("iter", ());
178178
words.insert("block", ());
179179
words.insert("import", ());
@@ -326,8 +326,6 @@ fn parse_proto(p: &parser) -> ast::proto {
326326
ret ast::proto_fn;
327327
} else if eat_word(p, "block") {
328328
ret ast::proto_block;
329-
} else if eat_word(p, "pred") {
330-
ret ast::proto_fn;
331329
} else { unexpected(p, p.peek()); }
332330
}
333331

@@ -2123,7 +2121,13 @@ fn parse_item(p: &parser, attrs: &[ast::attribute]) -> option::t<@ast::item> {
21232121
p.bump();
21242122
ret some(parse_item_fn_or_iter(p, ast::impure_fn, ast::proto_fn,
21252123
attrs, ast::il_normal));
2126-
} else if eat_word(p, "pred") {
2124+
} else if eat_word(p, "pure") {
2125+
expect_word(p, "fn");
2126+
ret some(parse_item_fn_or_iter(p, ast::pure_fn, ast::proto_fn, attrs,
2127+
ast::il_normal));
2128+
}
2129+
// FIXME: remove
2130+
else if eat_word(p, "pred") {
21272131
ret some(parse_item_fn_or_iter(p, ast::pure_fn, ast::proto_fn, attrs,
21282132
ast::il_normal));
21292133
} else if eat_word(p, "iter") {

trunk/src/comp/syntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ fn print_fn(s: &ps, decl: ast::fn_decl, proto: ast::proto, name: str,
11971197
typarams: &[ast::ty_param], constrs: [@ast::constr]) {
11981198
alt decl.purity {
11991199
ast::impure_fn. { head(s, proto_to_str(proto)); }
1200-
_ { head(s, "pred"); }
1200+
_ { head(s, "pure fn"); }
12011201
}
12021202
word(s.s, name);
12031203
print_type_params(s, typarams);

0 commit comments

Comments
 (0)