Improve AST nodes
Signed-off-by: CHatingPython <chatingpython@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@ TEST(Parser, EmptyFunctions) {
|
||||
{
|
||||
auto first = program->declarations()[0];
|
||||
EXPECT_TRUE(first.present());
|
||||
EXPECT_EQ(first->type(), declaration_node_t::FunctionDefinition);
|
||||
EXPECT_EQ(first->declaration_type(), declaration_node_t::FunctionDefinition);
|
||||
node_handle<function_definition_node> funcDef = first;
|
||||
EXPECT_EQ(funcDef->name().value, "main");
|
||||
EXPECT_EQ(funcDef->body()->statements.size(), 0);
|
||||
@@ -24,7 +24,7 @@ TEST(Parser, EmptyFunctions) {
|
||||
{
|
||||
auto second = program->declarations()[1];
|
||||
EXPECT_TRUE(second.present());
|
||||
EXPECT_EQ(second->type(), declaration_node_t::FunctionDeclaration);
|
||||
EXPECT_EQ(second->declaration_type(), declaration_node_t::FunctionDeclaration);
|
||||
node_handle<function_declarartion_node> funcDecl = second;
|
||||
EXPECT_EQ(funcDecl->name().value, "foo");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user