mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibCpp: Add some missing accessors to AST nodes
This commit is contained in:
parent
14a86c8fd6
commit
f9d485191d
1 changed files with 6 additions and 1 deletions
|
@ -343,7 +343,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Vector<NonnullRefPtr<Declaration const>> declarations() const override;
|
virtual Vector<NonnullRefPtr<Declaration const>> declarations() const override;
|
||||||
Vector<NonnullRefPtr<Statement const>> const& statements() { return m_statements; }
|
Vector<NonnullRefPtr<Statement const>> const& statements() const { return m_statements; }
|
||||||
void add_statement(NonnullRefPtr<Statement const>&& statement) { m_statements.append(move(statement)); }
|
void add_statement(NonnullRefPtr<Statement const>&& statement) { m_statements.append(move(statement)); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -504,6 +504,8 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringView value() const { return m_value; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StringView m_value;
|
StringView m_value;
|
||||||
};
|
};
|
||||||
|
@ -825,6 +827,8 @@ public:
|
||||||
|
|
||||||
void add_statement(NonnullRefPtr<Statement const>&& statement) { m_statements.append(move(statement)); }
|
void add_statement(NonnullRefPtr<Statement const>&& statement) { m_statements.append(move(statement)); }
|
||||||
|
|
||||||
|
Vector<NonnullRefPtr<Statement const>> const& statements() const { return m_statements; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Vector<NonnullRefPtr<Statement const>> m_statements;
|
Vector<NonnullRefPtr<Statement const>> m_statements;
|
||||||
};
|
};
|
||||||
|
@ -856,6 +860,7 @@ public:
|
||||||
void set_then_statement(RefPtr<Statement const>&& then) { m_then = move(then); }
|
void set_then_statement(RefPtr<Statement const>&& then) { m_then = move(then); }
|
||||||
void set_else_statement(RefPtr<Statement const>&& _else) { m_else = move(_else); }
|
void set_else_statement(RefPtr<Statement const>&& _else) { m_else = move(_else); }
|
||||||
|
|
||||||
|
Expression const* predicate() const { return m_predicate.ptr(); }
|
||||||
Statement const* then_statement() const { return m_then.ptr(); }
|
Statement const* then_statement() const { return m_then.ptr(); }
|
||||||
Statement const* else_statement() const { return m_else.ptr(); }
|
Statement const* else_statement() const { return m_else.ptr(); }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue