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:
parent
e8f040139b
commit
8ed65d7b48
4 changed files with 70 additions and 0 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue