rustc: Print node IDs for more types of nodes

This commit is contained in:
Patrick Walton 2011-06-02 11:27:35 -07:00
parent 7c6a0f189e
commit 12f86e6f2f

View File

@ -439,6 +439,15 @@ fn print_item(&ps s, &@ast::item item) {
bclose(s, item.span);
}
}
// Print the node ID if necessary. TODO: type as well.
alt (s.mode) {
case (mo_identified) {
space(s.s);
synth_comment(s, uint::to_str(ty::item_ann(item).id, 10u));
}
case (_) { /* no-op */ }
}
}
fn print_stmt(&ps s, &ast::stmt st) {
@ -473,6 +482,15 @@ fn print_block(&ps s, ast::block blk) {
case (_) {}
}
bclose(s, blk.span);
// Print the node ID if necessary: TODO: type as well.
alt (s.mode) {
case (mo_identified) {
space(s.s);
synth_comment(s, "block " + uint::to_str(blk.node.a.id, 10u));
}
case (_) { /* no-op */ }
}
}
fn print_literal(&ps s, &@ast::lit lit) {
@ -977,6 +995,15 @@ fn print_pat(&ps s, &@ast::pat pat) {
}
}
}
// Print the node ID if necessary. TODO: type as well.
alt (s.mode) {
case (mo_identified) {
space(s.s);
synth_comment(s, uint::to_str(ty::pat_ann(pat).id, 10u));
}
case (_) { /* no-op */ }
}
}
fn print_fn(&ps s, ast::fn_decl decl, ast::proto proto, str name,