feat(printer) Print ContinueStatement (#1276)

This commit is contained in:
Cameron 2023-11-13 18:29:28 +00:00 committed by GitHub
parent 4ea0aacdb4
commit 2adfec6c0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -153,7 +153,15 @@ impl<'a> Format<'a> for DoWhileStatement<'a> {
impl<'a> Format<'a> for ContinueStatement {
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
Doc::Line
let mut parts = p.vec();
parts.push(string!(p, "continue"));
if let Some(label) = &self.label {
parts.push(string!(p, " "));
parts.push(format!(p, label));
}
Doc::Array(parts)
}
}