mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 12:00:18 +00:00
up
This commit is contained in:
parent
d45e348340
commit
998e3e4249
@ -162,6 +162,8 @@ All kinds of contributions are welcome.
|
||||
- any suggestions
|
||||
- any questions
|
||||
|
||||
Check our [Coding Style Guide](https://pocketpy.dev/coding_style_guide/) if you want to contribute C++ code.
|
||||
|
||||
## Reference
|
||||
|
||||
+ [cpython](https://github.com/python/cpython)
|
||||
|
@ -254,12 +254,14 @@ struct Frame {
|
||||
if(_next_ip >= co->codes.size()){
|
||||
while(i>=0){
|
||||
if(co->blocks[i].type == FOR_LOOP) pop();
|
||||
else if(co->blocks[i].type == TRY_EXCEPT) on_try_block_exit();
|
||||
i = co->blocks[i].parent;
|
||||
}
|
||||
}else{
|
||||
const Bytecode& next = co->codes[target];
|
||||
while(i>=0 && i!=next.block){
|
||||
if(co->blocks[i].type == FOR_LOOP) pop();
|
||||
else if(co->blocks[i].type == TRY_EXCEPT) on_try_block_exit();
|
||||
i = co->blocks[i].parent;
|
||||
}
|
||||
if(i!=next.block) throw std::runtime_error("invalid jump");
|
||||
|
@ -35,11 +35,8 @@
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
#define PK_VERSION "0.8.2"
|
||||
#define PK_VERSION "0.8.3"
|
||||
|
||||
typedef int64_t i64;
|
||||
typedef double f64;
|
||||
#define DUMMY_VAL (i64)0
|
||||
|
||||
#define CPP_LAMBDA(x) ([](VM* vm, const pkpy::Args& args) { return x; })
|
||||
#define CPP_NOT_IMPLEMENTED() ([](VM* vm, const pkpy::Args& args) { vm->NotImplementedError(); return vm->None; })
|
@ -5,6 +5,9 @@
|
||||
#include "repl.h"
|
||||
#include "iter.h"
|
||||
|
||||
#define CPP_LAMBDA(x) ([](VM* vm, const pkpy::Args& args) { return x; })
|
||||
#define CPP_NOT_IMPLEMENTED() ([](VM* vm, const pkpy::Args& args) { vm->NotImplementedError(); return vm->None; })
|
||||
|
||||
_Code VM::compile(_Str source, _Str filename, CompileMode mode) {
|
||||
Compiler compiler(this, source.c_str(), filename, mode);
|
||||
try{
|
||||
|
Loading…
x
Reference in New Issue
Block a user