Add GEN_START support (#392)

* 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
This commit is contained in:
TheHellTower
2023-10-20 16:42:33 -04:00
committed by Michael Hansen
parent d62c8adf89
commit b32f231e33
4 changed files with 8 additions and 0 deletions

View File

@@ -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;

Binary file not shown.

2
tests/input/GEN_START.py Normal file
View File

@@ -0,0 +1,2 @@
def GEN_START():
yield 0

View File

@@ -0,0 +1,3 @@
def GEN_START ( ) : <EOL>
<INDENT>
yield 0 <EOL>