From e464c638ad0dcd1ad74f0658a0a5719afffbc02d Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 25 Jun 2023 16:14:36 +0800 Subject: [PATCH] ... --- src/expr.h | 8 ++++++++ src/pocketpy.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/expr.h b/src/expr.h index b942d960..3c8970c4 100644 --- a/src/expr.h +++ b/src/expr.h @@ -745,6 +745,14 @@ struct GroupedExpr: Expr{ void emit(CodeEmitContext* ctx) override{ a->emit(ctx); } + + bool emit_del(CodeEmitContext* ctx) override { + return a->emit_del(ctx); + } + + bool emit_store(CodeEmitContext* ctx) override { + return a->emit_store(ctx); + } }; struct BinaryExpr: Expr{ diff --git a/src/pocketpy.h b/src/pocketpy.h index 81f53fdc..8411bde0 100644 --- a/src/pocketpy.h +++ b/src/pocketpy.h @@ -325,6 +325,7 @@ inline void init_builtins(VM* _vm) { /************ int ************/ _vm->bind_constructor<-1>("int", [](VM* vm, ArgsView args) { + if(args.size() == 1+0) return VAR(0); if(args.size() == 1+1){ if (is_type(args[1], vm->tp_float)) return VAR((i64)CAST(f64, args[1])); if (is_type(args[1], vm->tp_int)) return args[1];