@@ -410,9 +410,9 @@ fn print_item(&ps s, &@ast::item item) {
410
410
alt ( item. node ) {
411
411
case ( ast:: item_const ( ?ty, ?expr) ) {
412
412
head ( s, "const" ) ;
413
+ word_space ( s, item. ident + ":" ) ;
413
414
print_type ( s, * ty) ;
414
415
space ( s. s ) ;
415
- word_space ( s, item. ident ) ;
416
416
end ( s) ; // end the head-ibox
417
417
418
418
word_space ( s, "=" ) ;
@@ -442,6 +442,9 @@ fn print_item(&ps s, &@ast::item item) {
442
442
case ( ast:: native_abi_rust_intrinsic) {
443
443
word_nbsp ( s, "\" rust-intrinsic\" " ) ;
444
444
}
445
+ case ( ast:: native_abi_x86stdcall) {
446
+ word_nbsp ( s, "\" x86stdcall\" " ) ;
447
+ }
445
448
}
446
449
word_nbsp ( s, "mod" ) ;
447
450
word_nbsp ( s, item. ident ) ;
@@ -510,9 +513,8 @@ fn print_item(&ps s, &@ast::item item) {
510
513
fn print_field ( & ps s, & ast:: obj_field field) {
511
514
ibox ( s, indent_unit) ;
512
515
print_mutability ( s, field. mut ) ;
516
+ word_space ( s, field. ident + ":" ) ;
513
517
print_type ( s, * field. ty ) ;
514
- space ( s. s ) ;
515
- word ( s. s , field. ident ) ;
516
518
end ( s) ;
517
519
}
518
520
fn get_span ( & ast:: obj_field f) -> codemap:: span { ret f. ty . span ; }
@@ -544,9 +546,8 @@ fn print_item(&ps s, &@ast::item item) {
544
546
word ( s. s , item. ident ) ;
545
547
print_type_params ( s, tps) ;
546
548
popen ( s) ;
549
+ word_space ( s, dt. decl . inputs . ( 0 ) . ident + ":" ) ;
547
550
print_type ( s, * dt. decl . inputs . ( 0 ) . ty ) ;
548
- space ( s. s ) ;
549
- word ( s. s , dt. decl . inputs . ( 0 ) . ident ) ;
550
551
pclose ( s) ;
551
552
space ( s. s ) ;
552
553
print_block ( s, dt. body ) ;
@@ -810,23 +811,19 @@ fn print_expr(&ps s, &@ast::expr expr) {
810
811
}
811
812
case ( ast:: expr_for ( ?decl, ?expr, ?blk) ) {
812
813
head ( s, "for" ) ;
813
- popen ( s) ;
814
814
print_for_decl ( s, decl) ;
815
815
space ( s. s ) ;
816
816
word_space ( s, "in" ) ;
817
817
print_expr ( s, expr) ;
818
- pclose ( s) ;
819
818
space ( s. s ) ;
820
819
print_block ( s, blk) ;
821
820
}
822
821
case ( ast:: expr_for_each ( ?decl, ?expr, ?blk) ) {
823
822
head ( s, "for each" ) ;
824
- popen ( s) ;
825
823
print_for_decl ( s, decl) ;
826
824
space ( s. s ) ;
827
825
word_space ( s, "in" ) ;
828
826
print_expr ( s, expr) ;
829
- pclose ( s) ;
830
827
space ( s. s ) ;
831
828
print_block ( s, blk) ;
832
829
}
@@ -869,10 +866,8 @@ fn print_expr(&ps s, &@ast::expr expr) {
869
866
}
870
867
case ( ast:: expr_block ( ?blk) ) {
871
868
// containing cbox, will be closed by print-block at }
872
-
873
869
cbox ( s, indent_unit) ;
874
870
// head-box, will be closed by print-block after {
875
-
876
871
ibox ( s, 0 u) ;
877
872
print_block ( s, blk) ;
878
873
}
@@ -1008,9 +1003,9 @@ fn print_expr(&ps s, &@ast::expr expr) {
1008
1003
fn print_field ( & ps s, & ast:: anon_obj_field field) {
1009
1004
ibox ( s, indent_unit) ;
1010
1005
print_mutability ( s, field. mut ) ;
1006
+ word_space ( s, field. ident + ":" ) ;
1011
1007
print_type ( s, * field. ty ) ;
1012
1008
space ( s. s ) ;
1013
- word ( s. s , field. ident ) ;
1014
1009
word_space ( s, "=" ) ;
1015
1010
print_expr ( s, field. expr ) ;
1016
1011
end ( s) ;
@@ -1067,8 +1062,7 @@ fn print_decl(&ps s, &@ast::decl decl) {
1067
1062
alt loc. node . ty {
1068
1063
some ( ?ty) {
1069
1064
ibox ( s, indent_unit) ;
1070
- word ( s. s , loc. node . ident ) ;
1071
- word_space ( s, ":" ) ;
1065
+ word_space ( s, loc. node . ident + ":" ) ;
1072
1066
print_type ( s, * ty) ;
1073
1067
end ( s) ;
1074
1068
}
@@ -1100,16 +1094,20 @@ fn print_decl(&ps s, &@ast::decl decl) {
1100
1094
fn print_ident( & ps s, & ast:: ident ident) { word( s. s , ident) ; }
1101
1095
1102
1096
fn print_for_decl( & ps s, @ast:: local loc) {
1097
+ word( s. s , loc. node . ident ) ;
1103
1098
alt ( loc. node . ty ) {
1104
- none { word( s. s , "auto" ) ; }
1105
- some ( ?t) { print_type ( s, * t) ; }
1099
+ some ( ?t) {
1100
+ word_space ( s, ":" ) ;
1101
+ print_type ( s, * t) ;
1102
+ }
1103
+ none { }
1106
1104
}
1107
1105
space ( s. s ) ;
1108
- word ( s. s , loc. node . ident ) ;
1109
1106
}
1110
1107
1111
1108
fn print_path ( & ps s, & ast:: path path) {
1112
1109
maybe_print_comment ( s, path. span . lo ) ;
1110
+ if path. node . global { word ( s. s , "::" ) ; }
1113
1111
auto first = true ;
1114
1112
for ( str id in path. node. idents) {
1115
1113
if ( first) { first = false ; } else { word ( s. s , "::" ) ; }
@@ -1128,14 +1126,16 @@ fn print_pat(&ps s, &@ast::pat pat) {
1128
1126
s. ann . pre ( ann_node) ;
1129
1127
alt ( pat. node ) {
1130
1128
case ( ast:: pat_wild) { word ( s. s , "_" ) ; }
1131
- case ( ast:: pat_bind ( ?id) ) { word ( s. s , "?" + id) ; }
1129
+ case ( ast:: pat_bind ( ?id) ) { word ( s. s , id) ; }
1132
1130
case ( ast:: pat_lit ( ?lit) ) { print_literal ( s, lit) ; }
1133
1131
case ( ast:: pat_tag ( ?path, ?args) ) {
1134
1132
print_path ( s, path) ;
1135
1133
if ( ivec:: len ( args) > 0 u) {
1136
1134
popen ( s) ;
1137
1135
commasep ( s, inconsistent, args, print_pat) ;
1138
1136
pclose ( s) ;
1137
+ } else {
1138
+ word ( s. s , "." ) ;
1139
1139
}
1140
1140
}
1141
1141
case ( ast:: pat_rec ( ?fields, ?etc) ) {
@@ -1182,10 +1182,9 @@ fn print_fn_args_and_ret(&ps s, &ast::fn_decl decl) {
1182
1182
popen ( s) ;
1183
1183
fn print_arg ( & ps s, & ast:: arg x) {
1184
1184
ibox ( s, indent_unit) ;
1185
+ word_space ( s, x. ident + ":" ) ;
1185
1186
print_alias ( s, x. mode ) ;
1186
1187
print_type ( s, * x. ty ) ;
1187
- space ( s. s ) ;
1188
- word ( s. s , x. ident ) ;
1189
1188
end ( s) ;
1190
1189
}
1191
1190
commasep ( s, inconsistent, decl. inputs , print_arg) ;
0 commit comments