From 5c8ad46ef785ea0fd1ea6b5258efeaa59dbfc1b9 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Wed, 11 May 2022 09:30:25 +1000 Subject: [PATCH] Add stubs for unimplemented statement types --- src/vstc/compile.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/vstc/compile.rs b/src/vstc/compile.rs index ba79bdf..ef544f0 100644 --- a/src/vstc/compile.rs +++ b/src/vstc/compile.rs @@ -188,6 +188,11 @@ impl Compiler { use swc_ecma_ast::Stmt::*; match statement { + Block(_) => std::panic!("Not implemented: Block statement"), + Empty(_) => std::panic!("Not implemented: Empty statement"), + Debugger(_) => std::panic!("Not implemented: Debugger statement"), + With(_) => std::panic!("Not supported: With statement"), + Return(ret_stmt) => match &ret_stmt.arg { None => { definition.push(" end".to_string()); @@ -206,7 +211,21 @@ impl Compiler { } }, }, - _ => std::panic!("Not implemented"), + + Labeled(_) => std::panic!("Not implemented: Labeled statement"), + Break(_) => std::panic!("Not implemented: Break statement"), + Continue(_) => std::panic!("Not implemented: Continue statement"), + If(_) => std::panic!("Not implemented: If statement"), + Switch(_) => std::panic!("Not implemented: Switch statement"), + Throw(_) => std::panic!("Not implemented: Throw statement"), + Try(_) => std::panic!("Not implemented: Try statement"), + While(_) => std::panic!("Not implemented: While statement"), + DoWhile(_) => std::panic!("Not implemented: DoWhile statement"), + For(_) => std::panic!("Not implemented: For statement"), + ForIn(_) => std::panic!("Not implemented: ForIn statement"), + ForOf(_) => std::panic!("Not implemented: ForOf statement"), + Decl(_) => std::panic!("Not implemented: Decl statement"), + Expr(_) => std::panic!("Not implemented: Expr statement"), } }