Allow only one return statement
This commit is contained in:
@ -466,11 +466,13 @@ namespace elna::boot
|
||||
class return_statement : public statement
|
||||
{
|
||||
public:
|
||||
expression *const return_expression{ nullptr };
|
||||
expression *m_return_expression;
|
||||
|
||||
return_statement(const struct position position, expression *return_expression = nullptr);
|
||||
return_statement(const struct position position, expression *return_expression);
|
||||
void accept(parser_visitor *visitor) override;
|
||||
|
||||
expression& return_expression();
|
||||
|
||||
virtual ~return_statement() override;
|
||||
};
|
||||
|
||||
@ -653,14 +655,10 @@ namespace elna::boot
|
||||
|
||||
public:
|
||||
const std::vector<conditional_statements *> branches;
|
||||
const std::optional<std::string> label;
|
||||
const std::vector<statement *> *alternative;
|
||||
|
||||
while_statement(const struct position position, conditional_statements *body,
|
||||
std::vector<conditional_statements *>&& branches, std::vector<statement *> *alternative = nullptr);
|
||||
while_statement(const struct position position, conditional_statements *body,
|
||||
std::vector<conditional_statements *>&& branches, const std::string& label,
|
||||
std::vector<statement *> *alternative = nullptr);
|
||||
void accept(parser_visitor *visitor) override;
|
||||
|
||||
conditional_statements& body();
|
||||
|
Reference in New Issue
Block a user