Skip to content

Commit 14c31c2

Browse files
committed
Flesh out type pp code.
1 parent f3798fd commit 14c31c2

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/comp/pretty/pprust.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ fn print_type(&ps s, &ast::ty ty) {
206206
case (ast::ty_machine(?tm)) { word(s.s, common::ty_mach_to_str(tm)); }
207207
case (ast::ty_char) { word(s.s, "char"); }
208208
case (ast::ty_str) { word(s.s, "str"); }
209+
case (ast::ty_istr) { word(s.s, "istr"); }
209210
case (ast::ty_box(?mt)) { word(s.s, "@"); print_mt(s, mt); }
210211
case (ast::ty_vec(?mt)) {
211212
word(s.s, "vec[");
@@ -218,6 +219,13 @@ fn print_type(&ps s, &ast::ty ty) {
218219
print_mutability(s, mt.mut);
219220
word(s.s, "]");
220221
}
222+
case (ast::ty_ptr(?mt)) {
223+
word(s.s, "*");
224+
print_mt(s, mt);
225+
}
226+
case (ast::ty_task) {
227+
word(s.s, "task");
228+
}
221229
case (ast::ty_port(?t)) {
222230
word(s.s, "port[");
223231
print_type(s, *t);
@@ -228,7 +236,6 @@ fn print_type(&ps s, &ast::ty ty) {
228236
print_type(s, *t);
229237
word(s.s, "]");
230238
}
231-
case (ast::ty_type) { word(s.s, "type"); }
232239
case (ast::ty_tup(?elts)) {
233240
word(s.s, "tup");
234241
popen(s);
@@ -249,6 +256,9 @@ fn print_type(&ps s, &ast::ty ty) {
249256
commasep_cmnt(s, consistent, fields, print_field, get_span);
250257
pclose(s);
251258
}
259+
case (ast::ty_fn(?proto, ?inputs, ?output, ?cf, ?constrs)) {
260+
print_ty_fn(s, proto, none[str], inputs, output, cf, constrs);
261+
}
252262
case (ast::ty_obj(?methods)) {
253263
head(s, "obj");
254264
bopen(s);
@@ -264,10 +274,15 @@ fn print_type(&ps s, &ast::ty ty) {
264274
}
265275
bclose(s, ty.span);
266276
}
267-
case (ast::ty_fn(?proto, ?inputs, ?output, ?cf, ?constrs)) {
268-
print_ty_fn(s, proto, none[str], inputs, output, cf, constrs);
269-
}
270277
case (ast::ty_path(?path, _)) { print_path(s, path); }
278+
case (ast::ty_type) { word(s.s, "type"); }
279+
case (ast::ty_constr(?t, ?cs)) {
280+
print_type(s, *t);
281+
space(s.s);
282+
word(s.s, ":");
283+
space(s.s);
284+
word(s.s, ast_constrs_str(cs));
285+
}
271286
}
272287
end(s);
273288
}

0 commit comments

Comments
 (0)