1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

LibCpp: Parse If statements

This commit is contained in:
Itamar 2021-01-29 12:03:02 +02:00 committed by Andreas Kling
parent e8f040139b
commit 8ed65d7b48
4 changed files with 70 additions and 0 deletions

View file

@ -581,4 +581,22 @@ public:
virtual ~Comment() override = default;
virtual const char* class_name() const override { return "Comment"; }
};
class IfStatement : public Statement {
public:
IfStatement(ASTNode* parent, Optional<Position> start, Optional<Position> end)
: Statement(parent, start, end)
{
}
virtual ~IfStatement() override = default;
virtual const char* class_name() const override { return "IfStatement"; }
virtual void dump(size_t indent) const override;
virtual NonnullRefPtrVector<Declaration> declarations() const override;
RefPtr<Expression> m_predicate;
RefPtr<Statement> m_then;
RefPtr<Statement> m_else;
};
}