Handle bound classes as constants during evaluation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <utility>
|
||||
|
||||
|
||||
#ifndef PORYGONLANG_BOUNDFUNCTIONDECLARATIONSTATEMENT_HPP
|
||||
#define PORYGONLANG_BOUNDFUNCTIONDECLARATIONSTATEMENT_HPP
|
||||
@@ -6,33 +8,32 @@
|
||||
#include "BoundStatement.hpp"
|
||||
|
||||
class BoundFunctionDeclarationStatement : public BoundStatement{
|
||||
BoundVariableKey* _key;
|
||||
std::shared_ptr<BoundBlockStatement> _block;
|
||||
std::shared_ptr<FunctionScriptType> _type;
|
||||
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 = shared_ptr<BoundBlockStatement>(block);
|
||||
_type = type;
|
||||
BoundFunctionDeclarationStatement(std::shared_ptr<FunctionScriptType> type, BoundVariableKey* key, BoundBlockStatement* block)
|
||||
:_key(key), _block(block), _type(std::move(type))
|
||||
{
|
||||
}
|
||||
|
||||
~BoundFunctionDeclarationStatement() final{
|
||||
delete _key;
|
||||
}
|
||||
|
||||
BoundStatementKind GetKind() final{
|
||||
const BoundStatementKind GetKind() const final{
|
||||
return BoundStatementKind ::FunctionDeclaration;
|
||||
}
|
||||
|
||||
BoundVariableKey* GetKey(){
|
||||
const BoundVariableKey* GetKey() const{
|
||||
return _key;
|
||||
}
|
||||
|
||||
std::shared_ptr<BoundBlockStatement> GetBlock(){
|
||||
const std::shared_ptr<BoundBlockStatement> GetBlock() const{
|
||||
return _block;
|
||||
}
|
||||
|
||||
std::shared_ptr<FunctionScriptType> GetType(){
|
||||
const std::shared_ptr<FunctionScriptType> GetType() const{
|
||||
return _type;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user