Update pocketpy.h

This commit is contained in:
blueloveTH 2023-02-06 17:30:37 +08:00
parent 802e5f8b20
commit e82e33b678

View File

@ -213,7 +213,7 @@ void __initializeBuiltinFunctions(VM* _vm) {
});
_vm->bindMethod<0>("int", "__json__", [](VM* vm, const pkpy::Args& args) {
return vm->PyStr(std::to_string((int)vm->PyInt_AS_C(args[0])));
return vm->PyStr(std::to_string(vm->PyInt_AS_C(args[0])));
});
#define __INT_BITWISE_OP(name,op) \
@ -829,7 +829,8 @@ extern "C" {
ss << f_header << ' ';
for(int i=0; i<args.size(); i++){
PyVar x = vm->call(args[i], __json__);
ss << vm->PyStr_AS_C(x) << ' ';
ss << vm->PyStr_AS_C(x);
if(i != args.size() - 1) ss << ' ';
}
switch(ret_code){
case 'i': return vm->PyInt(f_int(ss.str().c_str()));