Skip to content

Commit 1f48148

Browse files
committed
---
yaml --- r: 13307 b: refs/heads/master c: 2adb3a5 h: refs/heads/master i: 13305: 9fb9fb3 13303: f0ee75e v: v3
1 parent 8055f32 commit 1f48148

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0d20717fab410cf1f90938d90ad4153b77b6f8b3
2+
refs/heads/master: 2adb3a5013c2a2d1fdbb27c0fb07a07aa2b83171
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libsyntax/ast_util.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ pure fn mk_sp(lo: uint, hi: uint) -> span {
2121
// make this a const, once the compiler supports it
2222
pure fn dummy_sp() -> span { ret mk_sp(0u, 0u); }
2323

24-
fn path_name(p: @path) -> str { path_name_i(p.idents) }
24+
pure fn path_name(p: @path) -> str { path_name_i(p.idents) }
2525

26-
fn path_name_i(idents: [ident]) -> str { str::connect(idents, "::") }
26+
pure fn path_name_i(idents: [ident]) -> str { str::connect(idents, "::") }
2727

28-
fn path_to_ident(p: @path) -> ident { vec::last(p.idents) }
28+
pure fn path_to_ident(p: @path) -> ident { vec::last(p.idents) }
2929

30-
fn local_def(id: node_id) -> def_id { {crate: local_crate, node: id} }
30+
pure fn local_def(id: node_id) -> def_id { {crate: local_crate, node: id} }
3131

3232
pure fn is_local(did: ast::def_id) -> bool { did.crate == local_crate }
3333

34-
fn stmt_id(s: stmt) -> node_id {
34+
pure fn stmt_id(s: stmt) -> node_id {
3535
alt s.node {
3636
stmt_decl(_, id) { id }
3737
stmt_expr(_, id) { id }
@@ -45,7 +45,7 @@ fn variant_def_ids(d: def) -> {enm: def_id, var: def_id} {
4545
_ { fail "non-variant in variant_def_ids"; } }
4646
}
4747

48-
fn def_id_of_def(d: def) -> def_id {
48+
pure fn def_id_of_def(d: def) -> def_id {
4949
alt d {
5050
def_fn(id, _) | def_mod(id) |
5151
def_native_mod(id) | def_const(id) |
@@ -60,7 +60,7 @@ fn def_id_of_def(d: def) -> def_id {
6060
}
6161
}
6262

63-
fn binop_to_str(op: binop) -> str {
63+
pure fn binop_to_str(op: binop) -> str {
6464
alt op {
6565
add { ret "+"; }
6666
subtract { ret "-"; }
@@ -95,7 +95,7 @@ pure fn is_shift_binop(b: binop) -> bool {
9595
}
9696
}
9797
98-
fn unop_to_str(op: unop) -> str {
98+
pure fn unop_to_str(op: unop) -> str {
9999
alt op {
100100
box(mt) { if mt == m_mutbl { ret "@mut "; } ret "@"; }
101101
uniq(mt) { if mt == m_mutbl { ret "~mut "; } ret "~"; }
@@ -105,19 +105,19 @@ fn unop_to_str(op: unop) -> str {
105105
}
106106
}
107107

108-
fn is_path(e: @expr) -> bool {
108+
pure fn is_path(e: @expr) -> bool {
109109
ret alt e.node { expr_path(_) { true } _ { false } };
110110
}
111111

112-
fn int_ty_to_str(t: int_ty) -> str {
112+
pure fn int_ty_to_str(t: int_ty) -> str {
113113
alt t {
114114
ty_char { "u8" } // ???
115115
ty_i { "" } ty_i8 { "i8" } ty_i16 { "i16" }
116116
ty_i32 { "i32" } ty_i64 { "i64" }
117117
}
118118
}
119119

120-
fn int_ty_max(t: int_ty) -> u64 {
120+
pure fn int_ty_max(t: int_ty) -> u64 {
121121
alt t {
122122
ty_i8 { 0x80u64 }
123123
ty_i16 { 0x8000u64 }
@@ -126,14 +126,14 @@ fn int_ty_max(t: int_ty) -> u64 {
126126
}
127127
}
128128

129-
fn uint_ty_to_str(t: uint_ty) -> str {
129+
pure fn uint_ty_to_str(t: uint_ty) -> str {
130130
alt t {
131131
ty_u { "u" } ty_u8 { "u8" } ty_u16 { "u16" }
132132
ty_u32 { "u32" } ty_u64 { "u64" }
133133
}
134134
}
135135

136-
fn uint_ty_max(t: uint_ty) -> u64 {
136+
pure fn uint_ty_max(t: uint_ty) -> u64 {
137137
alt t {
138138
ty_u8 { 0xffu64 }
139139
ty_u16 { 0xffffu64 }
@@ -142,7 +142,7 @@ fn uint_ty_max(t: uint_ty) -> u64 {
142142
}
143143
}
144144

145-
fn float_ty_to_str(t: float_ty) -> str {
145+
pure fn float_ty_to_str(t: float_ty) -> str {
146146
alt t { ty_f { "" } ty_f32 { "f32" } ty_f64 { "f64" } }
147147
}
148148

0 commit comments

Comments
 (0)