mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
up
This commit is contained in:
parent
b5518062ea
commit
985e5151ee
@ -174,4 +174,7 @@ T& py_cast(VM* vm, const PyVar& var) { UNREACHABLE(); }
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
T& _py_cast(VM* vm, const PyVar& var) { UNREACHABLE(); }
|
T& _py_cast(VM* vm, const PyVar& var) { UNREACHABLE(); }
|
||||||
|
|
||||||
|
#define VAR(x) py_var(vm, x)
|
||||||
|
|
||||||
|
|
||||||
} // namespace pkpy
|
} // namespace pkpy
|
2
src/vm.h
2
src/vm.h
@ -34,6 +34,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class VM {
|
class VM {
|
||||||
|
VM* vm; // self reference for simplify code
|
||||||
public:
|
public:
|
||||||
std::stack< std::unique_ptr<Frame> > callstack;
|
std::stack< std::unique_ptr<Frame> > callstack;
|
||||||
PyVar _py_op_call;
|
PyVar _py_op_call;
|
||||||
@ -57,6 +58,7 @@ public:
|
|||||||
int recursionlimit = 1000;
|
int recursionlimit = 1000;
|
||||||
|
|
||||||
VM(bool use_stdio){
|
VM(bool use_stdio){
|
||||||
|
this->vm = this;
|
||||||
this->use_stdio = use_stdio;
|
this->use_stdio = use_stdio;
|
||||||
if(use_stdio){
|
if(use_stdio){
|
||||||
this->_stdout = &std::cout;
|
this->_stdout = &std::cout;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user