This commit is contained in:
blueloveTH 2023-01-09 14:11:32 +08:00
parent 7ae1928981
commit 90ae5edac2
4 changed files with 7 additions and 3 deletions

View File

@ -3080,7 +3080,7 @@ struct PyObject {
// currently __name__ is only used for 'type'
PyVar _typeName(){ return _type->attribs[__name__]; }
PyObject(PyVar type) : _type(type) {}
PyObject(const PyVar& type) : _type(type) {}
virtual ~PyObject() = default;
};

View File

@ -144,6 +144,10 @@ struct CodeObject {
co_consts.push_back(v);
return co_consts.size() - 1;
}
void optimize_level_1(){
}
};
class Frame {

View File

@ -77,7 +77,7 @@ struct PyObject {
// currently __name__ is only used for 'type'
PyVar _typeName(){ return _type->attribs[__name__]; }
PyObject(PyVar type) : _type(type) {}
PyObject(const PyVar& type) : _type(type) {}
virtual ~PyObject() = default;
};

View File

@ -555,7 +555,7 @@ public:
if(_module == nullptr) _module = _main;
try {
_Code code = compile(source, filename, mode);
// if(filename != "<builtins>") std::cout << disassemble(code) << std::endl;
if(filename != "<builtins>") std::cout << disassemble(code) << std::endl;
return _exec(code, _module, {});
}catch (const _Error& e){
*_stderr << e.what() << '\n';