about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/print/pprust.rs20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 54672d9da2e..2d110aab879 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -445,20 +445,6 @@ pub trait PrintState<'a> {
 
     fn pclose(&mut self) { self.writer().word(")") }
 
-    fn is_begin(&mut self) -> bool {
-        match self.writer().last_token() {
-            pp::Token::Begin(_) => true,
-            _ => false,
-        }
-    }
-
-    fn is_end(&mut self) -> bool {
-        match self.writer().last_token() {
-            pp::Token::End => true,
-            _ => false,
-        }
-    }
-
     // is this the beginning of a line?
     fn is_bol(&mut self) -> bool {
         self.writer().last_token().is_eof() || self.writer().last_token().is_hardbreak_tok()
@@ -545,11 +531,13 @@ pub trait PrintState<'a> {
             }
             comments::BlankLine => {
                 // We need to do at least one, possibly two hardbreaks.
-                let is_semi = match self.writer().last_token() {
+                let twice = match self.writer().last_token() {
                     pp::Token::String(s, _) => ";" == s,
+                    pp::Token::Begin(_) => true,
+                    pp::Token::End => true,
                     _ => false
                 };
-                if is_semi || self.is_begin() || self.is_end() {
+                if twice {
                     self.writer().hardbreak();
                 }
                 self.writer().hardbreak();