renamed function->block to function->body
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
namespace ast {
|
||||
function_literal::function_literal(token::token token)
|
||||
: token(std::move(token)),
|
||||
block(nullptr) {};
|
||||
body(nullptr) {};
|
||||
|
||||
std::string function_literal::token_literal() const {
|
||||
return token.literal;
|
||||
@@ -22,14 +22,14 @@ namespace ast {
|
||||
first = false;
|
||||
}
|
||||
ss << ")";
|
||||
ss << block->str();
|
||||
ss << body->str();
|
||||
return ss.str();
|
||||
};
|
||||
|
||||
function_literal::~function_literal() {
|
||||
for (auto& param : parameters)
|
||||
delete param;
|
||||
if (block != nullptr)
|
||||
delete block;
|
||||
if (body != nullptr)
|
||||
delete body;
|
||||
}
|
||||
} // namespace ast
|
||||
|
@@ -12,7 +12,7 @@ namespace ast {
|
||||
function_literal(token::token);
|
||||
token::token token;
|
||||
std::vector<identifier*> parameters;
|
||||
ast::block_stmt* block;
|
||||
ast::block_stmt* body;
|
||||
|
||||
std::string token_literal() const override;
|
||||
std::string str() const override;
|
||||
|
@@ -282,7 +282,7 @@ namespace parser {
|
||||
delete ret;
|
||||
return nullptr;
|
||||
}
|
||||
ret->block = parse_block();
|
||||
ret->body = parse_block();
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
Reference in New Issue
Block a user