Files
PorygonLang/src/Binder/BoundStatements/BoundFunctionDeclarationStatement.hpp
Deukhoofd 10a2535c96
All checks were successful
continuous-integration/drone/push Build is passing
Handle bound classes as constants during evaluation
2019-06-13 17:12:46 +02:00

44 lines
1.1 KiB
C++

#include <utility>
#ifndef PORYGONLANG_BOUNDFUNCTIONDECLARATIONSTATEMENT_HPP
#define PORYGONLANG_BOUNDFUNCTIONDECLARATIONSTATEMENT_HPP
#include <memory>
#include "BoundStatement.hpp"
class BoundFunctionDeclarationStatement : public BoundStatement{
const BoundVariableKey* _key;
const std::shared_ptr<BoundBlockStatement> _block;
const std::shared_ptr<FunctionScriptType> _type;
public:
BoundFunctionDeclarationStatement(std::shared_ptr<FunctionScriptType> type, BoundVariableKey* key, BoundBlockStatement* block)
:_key(key), _block(block), _type(std::move(type))
{
}
~BoundFunctionDeclarationStatement() final{
delete _key;
}
const BoundStatementKind GetKind() const final{
return BoundStatementKind ::FunctionDeclaration;
}
const BoundVariableKey* GetKey() const{
return _key;
}
const std::shared_ptr<BoundBlockStatement> GetBlock() const{
return _block;
}
const std::shared_ptr<FunctionScriptType> GetType() const{
return _type;
}
};
#include "BoundStatement.hpp"
#endif //PORYGONLANG_BOUNDFUNCTIONDECLARATIONSTATEMENT_HPP