Support while … else
This commit is contained in:
40
boot/ast.cc
40
boot/ast.cc
@ -223,9 +223,9 @@ namespace elna::boot
|
||||
return this;
|
||||
}
|
||||
|
||||
variable_declaration::variable_declaration(const struct position position, const std::string& identifier,
|
||||
std::shared_ptr<type_expression> variable_type, const bool exported)
|
||||
: definition(position, identifier, exported), m_variable_type(variable_type)
|
||||
variable_declaration::variable_declaration(const struct position position, identifier_definition identifier,
|
||||
std::shared_ptr<type_expression> variable_type)
|
||||
: definition(position, identifier), m_variable_type(variable_type)
|
||||
{
|
||||
}
|
||||
|
||||
@ -239,14 +239,14 @@ namespace elna::boot
|
||||
return *m_variable_type;
|
||||
}
|
||||
|
||||
definition::definition(const struct position position, const std::string& identifier, const bool exported)
|
||||
: node(position), identifier(identifier), exported(exported)
|
||||
definition::definition(const struct position position, identifier_definition identifier)
|
||||
: node(position), identifier(identifier)
|
||||
{
|
||||
}
|
||||
|
||||
constant_definition::constant_definition(const struct position position, const std::string& identifier,
|
||||
const bool exported, expression *body)
|
||||
: definition(position, identifier, exported), m_body(body)
|
||||
constant_definition::constant_definition(const struct position position, identifier_definition identifier,
|
||||
expression *body)
|
||||
: definition(position, identifier), m_body(body)
|
||||
{
|
||||
}
|
||||
|
||||
@ -307,9 +307,9 @@ namespace elna::boot
|
||||
return this;
|
||||
}
|
||||
|
||||
procedure_definition::procedure_definition(const struct position position, const std::string& identifier,
|
||||
const bool exported, procedure_type_expression *heading, block *body)
|
||||
: definition(position, identifier, exported), m_heading(heading), body(body)
|
||||
procedure_definition::procedure_definition(const struct position position, identifier_definition identifier,
|
||||
procedure_type_expression *heading, block *body)
|
||||
: definition(position, identifier), m_heading(heading), body(body)
|
||||
{
|
||||
}
|
||||
|
||||
@ -329,9 +329,9 @@ namespace elna::boot
|
||||
delete body;
|
||||
}
|
||||
|
||||
type_definition::type_definition(const struct position position, const std::string& identifier,
|
||||
const bool exported, type_expression *body)
|
||||
: definition(position, identifier, exported), m_body(body)
|
||||
type_definition::type_definition(const struct position position, identifier_definition identifier,
|
||||
type_expression *body)
|
||||
: definition(position, identifier), m_body(body)
|
||||
{
|
||||
}
|
||||
|
||||
@ -811,8 +811,9 @@ namespace elna::boot
|
||||
}
|
||||
|
||||
if_statement::if_statement(const struct position position, conditional_statements *body,
|
||||
std::vector<conditional_statements *>&& branches,
|
||||
std::vector<statement *> *alternative)
|
||||
: node(position), m_body(body), alternative(alternative)
|
||||
: node(position), m_body(body), branches(std::move(branches)), alternative(alternative)
|
||||
{
|
||||
}
|
||||
|
||||
@ -848,14 +849,15 @@ namespace elna::boot
|
||||
}
|
||||
|
||||
while_statement::while_statement(const struct position position, conditional_statements *body,
|
||||
std::vector<conditional_statements *>&& branches)
|
||||
: node(position), m_body(body), branches(std::move(branches))
|
||||
std::vector<conditional_statements *>&& branches, std::vector<statement *> *alternative)
|
||||
: node(position), m_body(body), branches(std::move(branches)), alternative(alternative)
|
||||
{
|
||||
}
|
||||
|
||||
while_statement::while_statement(const struct position position, conditional_statements *body,
|
||||
std::vector<conditional_statements *>&& branches, const std::string& label)
|
||||
: node(position), m_body(body), branches(std::move(branches)), label(label)
|
||||
std::vector<conditional_statements *>&& branches, const std::string& label,
|
||||
std::vector<statement *> *alternative)
|
||||
: node(position), m_body(body), branches(std::move(branches)), label(label), alternative(alternative)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user