This commit is contained in:
blueloveTH 2023-12-26 21:44:02 +08:00
parent 783f3b7ebd
commit f7fb3c1c98
3 changed files with 3 additions and 3 deletions

View File

@ -465,7 +465,7 @@ public:
void delattr(PyObject* obj, StrName name);
PyObject* get_unbound_method(PyObject* obj, StrName name, PyObject** self, bool throw_err=true, bool fallback=false);
void parse_int_slice(const Slice& s, int length, int& start, int& stop, int& step);
PyObject* format(Str, PyObject*);
PyObject* _format_string(Str, PyObject*);
void setattr(PyObject* obj, StrName name, PyObject* value);
template<int ARGC>
PyObject* bind_method(PyObject*, Str, NativeFuncC);

View File

@ -805,7 +805,7 @@ __NEXT_STEP:;
TARGET(FORMAT_STRING) {
PyObject* _0 = POPX();
const Str& spec = CAST(Str&, co_consts[byte.arg]);
PUSH(format(spec, _0));
PUSH(_format_string(spec, _0));
} DISPATCH();
/*****************************************/
TARGET(INC_FAST){

View File

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