From c78c330634997e5d8e2ec27db9e3d9cf50bae230 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 6 Dec 2014 01:06:24 +0100 Subject: Const AST visitor for the compiler. --- AST.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'AST.h') diff --git a/AST.h b/AST.h index e1044618..966acb97 100644 --- a/AST.h +++ b/AST.h @@ -245,10 +245,10 @@ public: bool isPublic() const { return m_isPublic; } bool isDeclaredConst() const { return m_isDeclaredConst; } std::vector> const& getParameters() const { return m_parameters->getParameters(); } - ParameterList& getParameterList() { return *m_parameters; } + ParameterList const& getParameterList() const { return *m_parameters; } std::vector> const& getReturnParameters() const { return m_returnParameters->getParameters(); } ASTPointer const& getReturnParameterList() const { return m_returnParameters; } - Block& getBody() { return *m_body; } + Block const& getBody() const { return *m_body; } /// @return A shared pointer of an ASTString. /// Can contain a nullptr in which case indicates absence of documentation ASTPointer const& getDocumentation() const { return m_documentation; } @@ -796,7 +796,7 @@ public: ASTString const& getName() const { return *m_name; } void setReferencedDeclaration(Declaration& _referencedDeclaration) { m_referencedDeclaration = &_referencedDeclaration; } - Declaration* getReferencedDeclaration() { return m_referencedDeclaration; } + Declaration const* getReferencedDeclaration() const { return m_referencedDeclaration; } private: ASTPointer m_name; -- cgit