This commit is contained in:
blueloveTH 2024-06-30 22:54:01 +08:00
parent 25ceed2703
commit 8bbb9fc5f3
3 changed files with 7 additions and 3 deletions

View File

@ -934,7 +934,9 @@ static void BinaryExpr__emit_(Expr* self_, Ctx* ctx) {
Ctx__emit_(ctx, opcode, arg, self->line); Ctx__emit_(ctx, opcode, arg, self->line);
c11__foreach(int, &jmps, i) { Ctx__patch_jump(ctx, *i); } for(int i = 0; i < jmps.count; i++) {
Ctx__patch_jump(ctx, c11__getitem(int, &jmps, i));
}
} }
BinaryExpr* BinaryExpr__new(int line, TokenIndex op, bool inplace) { BinaryExpr* BinaryExpr__new(int line, TokenIndex op, bool inplace) {

View File

@ -80,7 +80,9 @@ void py_newfunction2(py_Ref out,
const py_Ref upvalue) {} const py_Ref upvalue) {}
void py_newnativefunc(py_Ref out, py_CFunction f) { void py_newnativefunc(py_Ref out, py_CFunction f) {
out->type = tp_nativefunc;
out->is_ptr = false;
out->_cfunc = f;
} }
void py_bindmethod(py_Type type, const char *name, py_CFunction f){ void py_bindmethod(py_Type type, const char *name, py_CFunction f){

View File

@ -25,7 +25,7 @@ int main(int argc, char** argv) {
#endif #endif
py_initialize(); py_initialize();
const char* source = "[1, 'a']"; const char* source = "[1+2, 'a']";
py_Ref r0 = py_reg(0); py_Ref r0 = py_reg(0);
if(py_eval(source, r0)){ if(py_eval(source, r0)){