Implement procedure pointers
This commit is contained in:
18
boot/ast.cc
18
boot/ast.cc
@ -46,7 +46,7 @@ namespace boot
|
||||
|
||||
void empty_visitor::visit(call_expression *expression)
|
||||
{
|
||||
for (auto& argument : expression->arguments())
|
||||
for (struct expression *const argument : expression->arguments)
|
||||
{
|
||||
argument->accept(this);
|
||||
}
|
||||
@ -734,8 +734,8 @@ namespace boot
|
||||
delete m_operand;
|
||||
}
|
||||
|
||||
call_expression::call_expression(const struct position position, const std::string& name)
|
||||
: expression(position), m_name(name)
|
||||
call_expression::call_expression(const struct position position, designator_expression *callable)
|
||||
: expression(position), m_callable(callable)
|
||||
{
|
||||
}
|
||||
|
||||
@ -744,22 +744,18 @@ namespace boot
|
||||
visitor->visit(this);
|
||||
}
|
||||
|
||||
std::string& call_expression::name()
|
||||
designator_expression& call_expression::callable()
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
std::vector<expression *>& call_expression::arguments()
|
||||
{
|
||||
return m_arguments;
|
||||
return *m_callable;
|
||||
}
|
||||
|
||||
call_expression::~call_expression()
|
||||
{
|
||||
for (auto argument : m_arguments)
|
||||
for (expression *const argument : arguments)
|
||||
{
|
||||
delete argument;
|
||||
}
|
||||
delete m_callable;
|
||||
}
|
||||
|
||||
cast_expression::cast_expression(const struct position position,
|
||||
|
Reference in New Issue
Block a user