131
131
//! it.
132
132
//!
133
133
//! In this implementation (following the paper, again) the SCAN process is the
134
- //! methods called `Printer::pretty_print_ *`, and the 'PRINT' process is the
134
+ //! methods called `Printer::scan_ *`, and the 'PRINT' process is the
135
135
//! method called `Printer::print`.
136
136
137
137
use std:: collections:: VecDeque ;
@@ -310,14 +310,14 @@ impl Printer {
310
310
self . buf [ self . right ] . token = t;
311
311
}
312
312
313
- fn pretty_print_eof ( & mut self ) {
313
+ fn scan_eof ( & mut self ) {
314
314
if !self . scan_stack . is_empty ( ) {
315
315
self . check_stack ( 0 ) ;
316
316
self . advance_left ( ) ;
317
317
}
318
318
}
319
319
320
- fn pretty_print_begin ( & mut self , b : BeginToken ) {
320
+ fn scan_begin ( & mut self , b : BeginToken ) {
321
321
if self . scan_stack . is_empty ( ) {
322
322
self . left_total = 1 ;
323
323
self . right_total = 1 ;
@@ -331,7 +331,7 @@ impl Printer {
331
331
self . scan_push ( BufEntry { token : Token :: Begin ( b) , size : -self . right_total } ) ;
332
332
}
333
333
334
- fn pretty_print_end ( & mut self ) {
334
+ fn scan_end ( & mut self ) {
335
335
if self . scan_stack . is_empty ( ) {
336
336
debug ! ( "pp End/print Vec<{},{}>" , self . left, self . right) ;
337
337
self . print_end ( ) ;
@@ -342,7 +342,7 @@ impl Printer {
342
342
}
343
343
}
344
344
345
- fn pretty_print_break ( & mut self , b : BreakToken ) {
345
+ fn scan_break ( & mut self , b : BreakToken ) {
346
346
if self . scan_stack . is_empty ( ) {
347
347
self . left_total = 1 ;
348
348
self . right_total = 1 ;
@@ -358,7 +358,7 @@ impl Printer {
358
358
self . right_total += b. blank_space ;
359
359
}
360
360
361
- fn pretty_print_string ( & mut self , s : Cow < ' static , str > , len : isize ) {
361
+ fn scan_string ( & mut self , s : Cow < ' static , str > , len : isize ) {
362
362
if self . scan_stack . is_empty ( ) {
363
363
debug ! ( "pp String('{}')/print Vec<{},{}>" ,
364
364
s, self . left, self . right) ;
@@ -594,7 +594,7 @@ impl Printer {
594
594
595
595
/// "raw box"
596
596
crate fn rbox ( & mut self , indent : usize , b : Breaks ) {
597
- self . pretty_print_begin ( BeginToken {
597
+ self . scan_begin ( BeginToken {
598
598
offset : indent as isize ,
599
599
breaks : b
600
600
} )
@@ -611,25 +611,25 @@ impl Printer {
611
611
}
612
612
613
613
pub fn break_offset ( & mut self , n : usize , off : isize ) {
614
- self . pretty_print_break ( BreakToken {
614
+ self . scan_break ( BreakToken {
615
615
offset : off,
616
616
blank_space : n as isize
617
617
} )
618
618
}
619
619
620
620
crate fn end ( & mut self ) {
621
- self . pretty_print_end ( )
621
+ self . scan_end ( )
622
622
}
623
623
624
624
pub fn eof ( mut self ) -> String {
625
- self . pretty_print_eof ( ) ;
625
+ self . scan_eof ( ) ;
626
626
self . out
627
627
}
628
628
629
629
pub fn word < S : Into < Cow < ' static , str > > > ( & mut self , wrd : S ) {
630
630
let s = wrd. into ( ) ;
631
631
let len = s. len ( ) as isize ;
632
- self . pretty_print_string ( s, len)
632
+ self . scan_string ( s, len)
633
633
}
634
634
635
635
fn spaces ( & mut self , n : usize ) {
0 commit comments