@@ -21,17 +21,17 @@ pure fn mk_sp(lo: uint, hi: uint) -> span {
21
21
// make this a const, once the compiler supports it
22
22
pure fn dummy_sp ( ) -> span { ret mk_sp ( 0 u, 0 u) ; }
23
23
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 ) }
25
25
26
- fn path_name_i ( idents : [ ident ] ) -> str { str:: connect ( idents, "::" ) }
26
+ pure fn path_name_i ( idents : [ ident ] ) -> str { str:: connect ( idents, "::" ) }
27
27
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 ) }
29
29
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} }
31
31
32
32
pure fn is_local ( did : ast:: def_id ) -> bool { did. crate == local_crate }
33
33
34
- fn stmt_id ( s : stmt ) -> node_id {
34
+ pure fn stmt_id ( s : stmt ) -> node_id {
35
35
alt s. node {
36
36
stmt_decl ( _, id) { id }
37
37
stmt_expr ( _, id) { id }
@@ -45,7 +45,7 @@ fn variant_def_ids(d: def) -> {enm: def_id, var: def_id} {
45
45
_ { fail "non-variant in variant_def_ids" ; } }
46
46
}
47
47
48
- fn def_id_of_def ( d : def ) -> def_id {
48
+ pure fn def_id_of_def ( d: def) -> def_id {
49
49
alt d {
50
50
def_fn( id, _) | def_mod ( id) |
51
51
def_native_mod ( id) | def_const ( id) |
@@ -60,7 +60,7 @@ fn def_id_of_def(d: def) -> def_id {
60
60
}
61
61
}
62
62
63
- fn binop_to_str ( op : binop ) -> str {
63
+ pure fn binop_to_str ( op: binop) -> str {
64
64
alt op {
65
65
add { ret "+"; }
66
66
subtract { ret " -"; }
@@ -95,7 +95,7 @@ pure fn is_shift_binop(b: binop) -> bool {
95
95
}
96
96
}
97
97
98
- fn unop_to_str(op: unop) -> str {
98
+ pure fn unop_to_str(op: unop) -> str {
99
99
alt op {
100
100
box(mt) { if mt == m_mutbl { ret " @mut "; } ret "@"; }
101
101
uniq ( mt) { if mt == m_mutbl { ret "~mut " ; } ret "~" ; }
@@ -105,19 +105,19 @@ fn unop_to_str(op: unop) -> str {
105
105
}
106
106
}
107
107
108
- fn is_path(e: @expr) -> bool {
108
+ pure fn is_path( e: @expr) -> bool {
109
109
ret alt e. node { expr_path ( _) { true } _ { false } } ;
110
110
}
111
111
112
- fn int_ty_to_str(t: int_ty) -> str {
112
+ pure fn int_ty_to_str ( t: int_ty) -> str {
113
113
alt t {
114
114
ty_char { "u8 " } // ???
115
115
ty_i { "" } ty_i8 { "i8" } ty_i16 { "i16" }
116
116
ty_i32 { "i32" } ty_i64 { "i64" }
117
117
}
118
118
}
119
119
120
- fn int_ty_max ( t : int_ty ) -> u64 {
120
+ pure fn int_ty_max ( t: int_ty) -> u64 {
121
121
alt t {
122
122
ty_i8 { 0x80u64 }
123
123
ty_i16 { 0x8000u64 }
@@ -126,14 +126,14 @@ fn int_ty_max(t: int_ty) -> u64 {
126
126
}
127
127
}
128
128
129
- fn uint_ty_to_str ( t : uint_ty ) -> str {
129
+ pure fn uint_ty_to_str ( t : uint_ty ) -> str {
130
130
alt t {
131
131
ty_u { "u" } ty_u8 { "u8" } ty_u16 { "u16" }
132
132
ty_u32 { "u32" } ty_u64 { "u64" }
133
133
}
134
134
}
135
135
136
- fn uint_ty_max ( t : uint_ty ) -> u64 {
136
+ pure fn uint_ty_max ( t: uint_ty) -> u64 {
137
137
alt t {
138
138
ty_u8 { 0xffu64 }
139
139
ty_u16 { 0xffffu64 }
@@ -142,7 +142,7 @@ fn uint_ty_max(t: uint_ty) -> u64 {
142
142
}
143
143
}
144
144
145
- fn float_ty_to_str ( t : float_ty ) -> str {
145
+ pure fn float_ty_to_str ( t : float_ty ) -> str {
146
146
alt t { ty_f { "" } ty_f32 { "f32" } ty_f64 { "f64" } }
147
147
}
148
148
0 commit comments