From 2adfec6c0f0e0ec881c486d941042b75a36bfd70 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 13 Nov 2023 18:29:28 +0000 Subject: [PATCH] feat(printer) Print `ContinueStatement` (#1276) --- crates/oxc_prettier/src/format.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/oxc_prettier/src/format.rs b/crates/oxc_prettier/src/format.rs index f3cf704bb..733a998ad 100644 --- a/crates/oxc_prettier/src/format.rs +++ b/crates/oxc_prettier/src/format.rs @@ -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) } }