feat(furc/parser): add if statement

This commit is contained in:
2026-08-08 00:04:04 +02:00
parent 212b1e2384
commit 84c6795ff8
2 changed files with 24 additions and 0 deletions
+11
View File
@@ -52,6 +52,7 @@ public:
Expression,
Compound,
If,
};
public:
category_e category() const override { return ast_node_cat::Statement; }
@@ -65,6 +66,16 @@ struct comp_stmt_node final : public stmt_node {
std::vector<stmt_node*> stmts;
};
class expr_node;
struct if_stmt_node final : public stmt_node {
stmt_type_e stmt_type() const override { return If; }
expr_node* cond = nullptr;
stmt_node* thenBranch = nullptr;
stmt_node* elseBranch = nullptr;
};
class decl_node : public stmt_node {
public:
enum decl_type_e {