blueloveTH hace 1 año
padre
commit
f91c4db49d
Se han modificado 3 ficheros con 3 adiciones y 3 borrados
  1. 1 1
      include/pocketpy/vm.h
  2. 1 1
      src/ceval.cpp
  3. 1 1
      src/vm.cpp

+ 1 - 1
include/pocketpy/vm.h

@@ -441,7 +441,7 @@ public:
 
     /***** Private *****/
     void __breakpoint();
-    PyObject* __format_string(Str, PyObject*);
+    PyObject* __format_object(PyObject*, Str);
     PyObject* __run_top_frame();
     void __pop_frame();
     PyObject* __py_generator(Frame&& frame, ArgsView buffer);

+ 1 - 1
src/ceval.cpp

@@ -945,7 +945,7 @@ __NEXT_STEP:;
     case OP_FORMAT_STRING: {
         PyObject* _0 = POPX();
         const Str& spec = CAST(Str&, co->consts[byte.arg]);
-        PUSH(__format_string(spec, _0));
+        PUSH(__format_object(_0, spec));
     } DISPATCH();
     /*****************************************/
     case OP_INC_FAST:{

+ 1 - 1
src/vm.cpp

@@ -499,7 +499,7 @@ i64 VM::py_hash(PyObject* obj){
     }
 }
 
-PyObject* VM::__format_string(Str spec, PyObject* obj){
+PyObject* VM::__format_object(PyObject* obj, Str spec){
     if(spec.empty()) return py_str(obj);
     char type;
     switch(spec.end()[-1]){