mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 20:10:17 +00:00
...
This commit is contained in:
parent
783f3b7ebd
commit
f7fb3c1c98
@ -465,7 +465,7 @@ public:
|
|||||||
void delattr(PyObject* obj, StrName name);
|
void delattr(PyObject* obj, StrName name);
|
||||||
PyObject* get_unbound_method(PyObject* obj, StrName name, PyObject** self, bool throw_err=true, bool fallback=false);
|
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);
|
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);
|
void setattr(PyObject* obj, StrName name, PyObject* value);
|
||||||
template<int ARGC>
|
template<int ARGC>
|
||||||
PyObject* bind_method(PyObject*, Str, NativeFuncC);
|
PyObject* bind_method(PyObject*, Str, NativeFuncC);
|
||||||
|
@ -805,7 +805,7 @@ __NEXT_STEP:;
|
|||||||
TARGET(FORMAT_STRING) {
|
TARGET(FORMAT_STRING) {
|
||||||
PyObject* _0 = POPX();
|
PyObject* _0 = POPX();
|
||||||
const Str& spec = CAST(Str&, co_consts[byte.arg]);
|
const Str& spec = CAST(Str&, co_consts[byte.arg]);
|
||||||
PUSH(format(spec, _0));
|
PUSH(_format_string(spec, _0));
|
||||||
} DISPATCH();
|
} DISPATCH();
|
||||||
/*****************************************/
|
/*****************************************/
|
||||||
TARGET(INC_FAST){
|
TARGET(INC_FAST){
|
||||||
|
@ -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);
|
if(spec.empty()) return py_str(obj);
|
||||||
char type;
|
char type;
|
||||||
switch(spec.end()[-1]){
|
switch(spec.end()[-1]){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user