Skip to content

Commit 6a1eba1

Browse files
committed
Add support for STORE_MAP.
1 parent f0d14cd commit 6a1eba1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ASTree.cpp

+12-1
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,17 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
256256
case Pyc::BUILD_MAP_A:
257257
stack.push(new ASTMap());
258258
break;
259+
case Pyc::STORE_MAP:
260+
{
261+
ASTList::value_t values;
262+
PycRef<ASTNode> key = stack.top();
263+
stack.pop();
264+
PycRef<ASTNode> value = stack.top();
265+
stack.pop();
266+
PycRef<ASTMap> map = stack.top().cast<ASTMap>();
267+
map->add(key, value);
268+
}
269+
break;
259270
case Pyc::BUILD_SLICE_A:
260271
{
261272
if (operand == 2) {
@@ -1051,7 +1062,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
10511062
curblock = blocks.top();
10521063
}
10531064
break;
1054-
}
1065+
}
10551066

10561067
if ((curblock->blktype() == ASTBlock::BLK_WHILE
10571068
&& !curblock->inited())

0 commit comments

Comments
 (0)