feat(furc/parser): add if statement
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user