blueloveTH 3 anos atrás
pai
commit
d53c4f1d09

+ 1 - 1
build_wasm.sh

@@ -1,3 +1,3 @@
 rm -rf web/lib/
 rm -rf web/lib/
 mkdir -p web/lib/
 mkdir -p web/lib/
-em++ src/main.cpp -fno-rtti -fexceptions -O3 -sEXPORTED_FUNCTIONS=_pkpy_delete,_pkpy_new_repl,_pkpy_repl_input,_pkpy_new_vm,_pkpy_vm_add_module,_pkpy_vm_eval,_pkpy_vm_exec,_pkpy_vm_get_global,_pkpy_vm_read_output -sEXPORTED_RUNTIME_METHODS=ccall -o web/lib/pocketpy.js
+em++ src/main.cpp -fno-rtti -fexceptions -O3 -sEXPORTED_FUNCTIONS=_pkpy_delete,_pkpy_setup_callbacks,_pkpy_new_repl,_pkpy_repl_input,_pkpy_new_vm,_pkpy_vm_add_module,_pkpy_vm_bind,_pkpy_vm_eval,_pkpy_vm_exec,_pkpy_vm_get_global,_pkpy_vm_read_output -sEXPORTED_RUNTIME_METHODS=ccall -o web/lib/pocketpy.js

+ 3 - 2
plugins/flutter/src/pocketpy.h

@@ -6140,7 +6140,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) \
@@ -6754,7 +6754,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()));

+ 1 - 1
plugins/godot/godot-cpp

@@ -1 +1 @@
-Subproject commit 5a56f312c7e20d3356eaa0ac2711c1abd0da802c
+Subproject commit 20ace497b54f2e625dc06ec95adf357fcdc27cd7

+ 3 - 2
plugins/macos/pocketpy/pocketpy.h

@@ -6140,7 +6140,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) \
@@ -6754,7 +6754,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()));