Implement elsif

This commit is contained in:
2025-01-27 01:16:27 +01:00
parent 1f7c1b4cb8
commit 18d8ded239
6 changed files with 115 additions and 155 deletions

View File

@ -34,6 +34,8 @@ namespace gcc
void build_binary_operation(bool condition, source::binary_expression *expression,
tree_code operator_code, tree left, tree right, tree target_type);
void make_if_branch(source::conditional_statements& branch, tree goto_endif);
public:
generic_visitor(std::shared_ptr<source::symbol_table<tree>> symbol_table);

View File

@ -617,6 +617,8 @@ namespace source
std::vector<statement *> *m_alternative;
public:
std::vector<conditional_statements *> branches;
if_statement(const struct position position, conditional_statements *body,
std::vector<statement *> *alternative = nullptr);
virtual void accept(parser_visitor *visitor) override;