Implements binding and evaluating function declarations
This commit is contained in:
@@ -16,6 +16,7 @@ enum class BoundStatementKind{
|
||||
Block,
|
||||
Expression,
|
||||
Assignment,
|
||||
FunctionDeclaration,
|
||||
};
|
||||
|
||||
class BoundStatement{
|
||||
@@ -114,4 +115,32 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class BoundFunctionDeclarationStatement : public BoundStatement{
|
||||
BoundVariableKey* _key;
|
||||
BoundBlockStatement* _block;
|
||||
FunctionScriptType* _type;
|
||||
public:
|
||||
BoundFunctionDeclarationStatement(FunctionScriptType* type, BoundVariableKey* key, BoundBlockStatement* block){
|
||||
_key = key;
|
||||
_block = block;
|
||||
_type = type;
|
||||
}
|
||||
|
||||
BoundStatementKind GetKind() final{
|
||||
return BoundStatementKind ::FunctionDeclaration;
|
||||
}
|
||||
|
||||
BoundVariableKey* GetKey(){
|
||||
return _key;
|
||||
}
|
||||
|
||||
BoundBlockStatement* GetBlock(){
|
||||
return _block;
|
||||
}
|
||||
|
||||
FunctionScriptType* GetType(){
|
||||
return _type;
|
||||
}
|
||||
};
|
||||
|
||||
#endif //PORYGONLANG_BOUNDSTATEMENT_HPP
|
||||
|
||||
Reference in New Issue
Block a user