mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
feat(printer) Print BreakStatement (#1274)
This commit is contained in:
parent
cef4c88579
commit
f892a9e8a1
1 changed files with 9 additions and 1 deletions
|
|
@ -159,7 +159,15 @@ impl<'a> Format<'a> for ContinueStatement {
|
|||
|
||||
impl<'a> Format<'a> for BreakStatement {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
let mut parts = p.vec();
|
||||
parts.push(string!(p, "break"));
|
||||
|
||||
if let Some(label) = &self.label {
|
||||
parts.push(string!(p, " "));
|
||||
parts.push(format!(p, label));
|
||||
}
|
||||
|
||||
Doc::Array(parts)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue