Top level as statement #103
This commit is contained in:
@@ -33,6 +33,7 @@ impl GenMist for Statement {
|
||||
cg.add("unsafe ");
|
||||
block.gen_mist(ctx, cg);
|
||||
}
|
||||
Statement::TopLevel(tl) => tl.gen_mist(ctx, cg),
|
||||
Statement::Block(block) => block.gen_mist(ctx, cg),
|
||||
Statement::VarDecl(VarDeclStmt { decl, init }) => {
|
||||
if decl.type_.is_some() {
|
||||
|
||||
@@ -31,13 +31,14 @@ impl GenRust for Block {
|
||||
impl GenRust for Statement {
|
||||
fn gen_rust(&self, ctx: &mut Context, cg: &mut RustCodegen) {
|
||||
match self {
|
||||
Statement::TopLevel(tl) => tl.gen_rust(ctx, cg),
|
||||
Statement::Block(block) => block.gen_rust(ctx, cg),
|
||||
|
||||
Statement::UnsafeBlock(block) => {
|
||||
cg.add("unsafe ");
|
||||
block.gen_rust(ctx, cg);
|
||||
}
|
||||
|
||||
Statement::Block(block) => block.gen_rust(ctx, cg),
|
||||
|
||||
Statement::VarDecl(VarDeclStmt { decl, init }) => {
|
||||
cg.add("let ");
|
||||
decl.gen_rust(ctx, cg);
|
||||
|
||||
Reference in New Issue
Block a user