Skip to content

Commit

Permalink
fix #396 Unsupported Node type: 27 (#397)
Browse files Browse the repository at this point in the history
* fix #396 Unsupported Node type: 27

* Add test file

* Modify a little comment

* Modify the test pyc file name

* Delete redundant pyc files

* retest

* Add newline at EOF

---------

Co-authored-by: Michael Hansen <zrax0111@gmail.com>
  • Loading branch information
ddouworld and zrax authored Nov 11, 2023
1 parent c7d3315 commit 5936412
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ASTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
bases.resize(basecnt);
PycRef<ASTNode> TOS = stack.top();
int TOS_type = TOS.type();
// bases are NODE_NAME at TOS
while (TOS_type == ASTNode::NODE_NAME) {
// bases are NODE_NAME and NODE_BINARY at TOS
while (TOS_type == ASTNode::NODE_NAME || TOS_type == ASTNode::NODE_BINARY) {
bases.resize(basecnt + 1);
bases[basecnt] = TOS;
basecnt++;
Expand Down
Binary file added tests/compiled/class_NODE_BINARY.3.9.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/input/class_NODE_BINARY.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Test
class MyNet(Test.t):
pass
4 changes: 4 additions & 0 deletions tests/tokenized/class_NODE_BINARY.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Test <EOL>
class MyNet ( Test . t ) : <EOL>
<INDENT>
pass <EOL>

0 comments on commit 5936412

Please sign in to comment.