Commit 922e70b6 authored by Jiahao Li's avatar Jiahao Li

Update ast.cpp to adapt new syntax tree

parent f6cee240
...@@ -119,7 +119,7 @@ AST::transform_node_iter(syntax_tree_node *n) { ...@@ -119,7 +119,7 @@ AST::transform_node_iter(syntax_tree_node *n) {
else else
node->type = TYPE_FLOAT; node->type = TYPE_FLOAT;
node->id = n->children[1]->name; node->id = n->children[1]->name;
if (n->children_num == 3) if (n->children_num > 2)
node->isarray = true; node->isarray = true;
return node; return node;
} else if (_STR_EQ(n->name, "compound-stmt")) { } else if (_STR_EQ(n->name, "compound-stmt")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment