File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ # !/usr/bin/perl -w
2
+
3
+ $ident = 0;
4
+ while (<>) {
5
+ if (/ ^rust: ">>/ ) {
6
+ $indent += 1;
7
+ } elsif (/ ^rust: "<</ ) {
8
+ $indent -= 1;
9
+ }
10
+
11
+ printf " %03d " , $indent ;
12
+ for ($i = 0; $i < $indent ; $i ++) {
13
+ printf (" " );
14
+ }
15
+ print ;
16
+ }
17
+
Original file line number Diff line number Diff line change @@ -5,6 +5,24 @@ import syntax::codemap::{span};
5
5
import syntax:: visit;
6
6
import syntax:: print;
7
7
8
+ fn indent < R > ( op : fn ( ) -> R ) -> R {
9
+ // Use in conjunction with the log post-processor like `src/etc/indenter`
10
+ // to make debug output more readable.
11
+ #debug[ ">>" ] ;
12
+ let r <- op ( ) ;
13
+ #debug[ "<< (Result = %?)" , r] ;
14
+ ret r;
15
+ }
16
+
17
+ resource _indenter( _i : ( ) ) {
18
+ #debug[ "<<" ] ;
19
+ }
20
+
21
+ fn indenter ( ) -> _indenter {
22
+ #debug[ ">>" ] ;
23
+ _indenter ( ( ) )
24
+ }
25
+
8
26
type flag = hashmap < str , ( ) > ;
9
27
10
28
fn def_eq ( a : ast:: def_id , b : ast:: def_id ) -> bool {
You can’t perform that action at this time.
0 commit comments