Skip to content

Commit

Permalink
Add GEN_START support (zrax#392)
Browse files Browse the repository at this point in the history
* Apparently should be enough ?

* Add `GEN_START` test

* Add `GEN_START` test compiled

* Add `GEN_START` test tokenized

* Smaller test since only POP is needed.

* Smaller test since only POP is needed.

* Smaller test since only POP is needed.

* dos2unix
  • Loading branch information
TheHellTower authored and zrax committed Oct 20, 2023
1 parent d62c8ad commit b32f231
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ASTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2419,6 +2419,9 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
case Pyc::PUSH_NULL:
stack.push(nullptr);
break;
case Pyc::GEN_START_A:
stack.pop();
break;
default:
fprintf(stderr, "Unsupported opcode: %s\n", Pyc::OpcodeName(opcode & 0xFF));
cleanBuild = false;
Expand Down
Binary file added tests/compiled/GEN_START.3.10.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/input/GEN_START.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def GEN_START():
yield 0
3 changes: 3 additions & 0 deletions tests/tokenized/GEN_START.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def GEN_START ( ) : <EOL>
<INDENT>
yield 0 <EOL>

0 comments on commit b32f231

Please sign in to comment.