mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
Update pocketpy.h
This commit is contained in:
parent
802e5f8b20
commit
e82e33b678
@ -213,7 +213,7 @@ void __initializeBuiltinFunctions(VM* _vm) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
_vm->bindMethod<0>("int", "__json__", [](VM* vm, const pkpy::Args& args) {
|
_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) \
|
#define __INT_BITWISE_OP(name,op) \
|
||||||
@ -829,7 +829,8 @@ extern "C" {
|
|||||||
ss << f_header << ' ';
|
ss << f_header << ' ';
|
||||||
for(int i=0; i<args.size(); i++){
|
for(int i=0; i<args.size(); i++){
|
||||||
PyVar x = vm->call(args[i], __json__);
|
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){
|
switch(ret_code){
|
||||||
case 'i': return vm->PyInt(f_int(ss.str().c_str()));
|
case 'i': return vm->PyInt(f_int(ss.str().c_str()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user