Read the input filename from the command line

This commit is contained in:
2025-02-02 08:22:40 +01:00
parent b41d6fb907
commit 607bf09434
9 changed files with 213 additions and 182 deletions

View File

@ -92,9 +92,13 @@ namespace boot
void empty_visitor::visit(block *block)
{
for (const auto definition : block->value_definitions)
for (const auto constant : block->constants)
{
definition->accept(this);
constant->accept(this);
}
for (const auto variable : block->variables)
{
variable->accept(this);
}
for (const auto body_statement : block->body)
{
@ -474,9 +478,8 @@ namespace boot
delete m_body;
}
block::block(const struct position position, std::vector<definition *>&& value_definitions,
std::vector<statement *>&& body)
: node(position), value_definitions(std::move(value_definitions)), body(std::move(body))
block::block(const struct position position)
: node(position)
{
}
@ -487,9 +490,13 @@ namespace boot
block::~block()
{
for (auto definition : this->value_definitions)
for (auto variable : this->variables)
{
delete definition;
delete variable;
}
for (auto constant : this->constants)
{
delete constant;
}
for (auto body_statement : this->body)
{
@ -497,10 +504,8 @@ namespace boot
}
}
program::program(const struct position position,
std::vector<definition *>&& type_definitions,
std::vector<definition *>&& value_definitions, std::vector<statement *>&& body)
: block(position, std::move(value_definitions), std::move(body)),
program::program(const struct position position, std::vector<definition *>&& type_definitions)
: block(position),
type_definitions(std::move(type_definitions))
{
}