44 lines
1.1 KiB
C++
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
|