Skip to content

Commit

Permalink
Support offsetting the most recent break
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Feb 3, 2022
1 parent 8bdf08f commit 63406ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_ast_pretty/src/pp.rs
Expand Up @@ -314,6 +314,12 @@ impl Printer {
}
}

pub fn offset(&mut self, offset: isize) {
if let Some(BufEntry { token: Token::Break(token), .. }) = &mut self.buf.last_mut() {
token.offset += offset;
}
}

fn check_stream(&mut self) {
while self.right_total - self.left_total > self.space {
if *self.scan_stack.front().unwrap() == self.buf.index_of_first() {
Expand Down

0 comments on commit 63406ac

Please sign in to comment.