mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
4e8920b280
commit
9fbaca3b13
@ -339,11 +339,6 @@ bool py_isidentical(py_Ref, py_Ref);
|
|||||||
/// The result will be set to `py_retval()`.
|
/// The result will be set to `py_retval()`.
|
||||||
/// The stack remains unchanged after the operation.
|
/// The stack remains unchanged after the operation.
|
||||||
bool py_call(py_Ref f, int argc, py_Ref argv) PY_RAISE;
|
bool py_call(py_Ref f, int argc, py_Ref argv) PY_RAISE;
|
||||||
/// Call a non-magic method.
|
|
||||||
/// It prepares the stack and then performs a `vectorcall(argc+1, 0, false)`.
|
|
||||||
/// The result will be set to `py_retval()`.
|
|
||||||
/// The stack remains unchanged after the operation.
|
|
||||||
bool py_callmethod(py_Ref self, py_Name name, int argc, py_Ref argv) PY_RAISE;
|
|
||||||
|
|
||||||
bool py_str(py_Ref val) PY_RAISE;
|
bool py_str(py_Ref val) PY_RAISE;
|
||||||
bool py_repr(py_Ref val) PY_RAISE;
|
bool py_repr(py_Ref val) PY_RAISE;
|
||||||
|
@ -476,7 +476,10 @@ FrameResult VM__run_top_frame(VM* self) {
|
|||||||
py_push(py_retval()); // empty set
|
py_push(py_retval()); // empty set
|
||||||
py_Name id_add = py_name("add");
|
py_Name id_add = py_name("add");
|
||||||
for(int i = 0; i < byte.arg; i++) {
|
for(int i = 0; i < byte.arg; i++) {
|
||||||
if(!py_callmethod(TOP(), id_add, 1, begin + i)) goto __ERROR;
|
py_push(TOP());
|
||||||
|
py_pushmethod(id_add);
|
||||||
|
py_push(begin + i);
|
||||||
|
if(!py_vectorcall(1, 0)) goto __ERROR;
|
||||||
}
|
}
|
||||||
py_TValue tmp = *TOP();
|
py_TValue tmp = *TOP();
|
||||||
SP() = begin;
|
SP() = begin;
|
||||||
|
@ -115,8 +115,6 @@ bool py_call(py_Ref f, int argc, py_Ref argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool py_callmethod(py_Ref self, py_Name name, int argc, py_Ref argv) { return -1; }
|
|
||||||
|
|
||||||
bool py_vectorcall(uint16_t argc, uint16_t kwargc) {
|
bool py_vectorcall(uint16_t argc, uint16_t kwargc) {
|
||||||
VM* vm = pk_current_vm;
|
VM* vm = pk_current_vm;
|
||||||
return VM__vectorcall(vm, argc, kwargc, false) != RES_ERROR;
|
return VM__vectorcall(vm, argc, kwargc, false) != RES_ERROR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user