mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 04:20:17 +00:00
up
This commit is contained in:
parent
7ae1928981
commit
90ae5edac2
@ -3080,7 +3080,7 @@ struct PyObject {
|
|||||||
// currently __name__ is only used for 'type'
|
// currently __name__ is only used for 'type'
|
||||||
PyVar _typeName(){ return _type->attribs[__name__]; }
|
PyVar _typeName(){ return _type->attribs[__name__]; }
|
||||||
|
|
||||||
PyObject(PyVar type) : _type(type) {}
|
PyObject(const PyVar& type) : _type(type) {}
|
||||||
virtual ~PyObject() = default;
|
virtual ~PyObject() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -144,6 +144,10 @@ struct CodeObject {
|
|||||||
co_consts.push_back(v);
|
co_consts.push_back(v);
|
||||||
return co_consts.size() - 1;
|
return co_consts.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void optimize_level_1(){
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Frame {
|
class Frame {
|
||||||
|
@ -77,7 +77,7 @@ struct PyObject {
|
|||||||
// currently __name__ is only used for 'type'
|
// currently __name__ is only used for 'type'
|
||||||
PyVar _typeName(){ return _type->attribs[__name__]; }
|
PyVar _typeName(){ return _type->attribs[__name__]; }
|
||||||
|
|
||||||
PyObject(PyVar type) : _type(type) {}
|
PyObject(const PyVar& type) : _type(type) {}
|
||||||
virtual ~PyObject() = default;
|
virtual ~PyObject() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
2
src/vm.h
2
src/vm.h
@ -555,7 +555,7 @@ public:
|
|||||||
if(_module == nullptr) _module = _main;
|
if(_module == nullptr) _module = _main;
|
||||||
try {
|
try {
|
||||||
_Code code = compile(source, filename, mode);
|
_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, {});
|
return _exec(code, _module, {});
|
||||||
}catch (const _Error& e){
|
}catch (const _Error& e){
|
||||||
*_stderr << e.what() << '\n';
|
*_stderr << e.what() << '\n';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user