Implements return statement
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,9 +1,8 @@
|
||||
#include <utility>
|
||||
|
||||
|
||||
#ifndef PORYGONLANG_BOUNDSTATEMENT_HPP
|
||||
#define PORYGONLANG_BOUNDSTATEMENT_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "../BoundExpressions/BoundExpression.hpp"
|
||||
#include "../BoundVariables/BoundVariableKey.hpp"
|
||||
@@ -18,6 +17,7 @@ enum class BoundStatementKind{
|
||||
Expression,
|
||||
Assignment,
|
||||
FunctionDeclaration,
|
||||
Return,
|
||||
};
|
||||
|
||||
class BoundStatement{
|
||||
@@ -116,6 +116,25 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class BoundReturnStatement : public BoundStatement{
|
||||
BoundExpression* _expression;
|
||||
public:
|
||||
explicit BoundReturnStatement(BoundExpression* expression){
|
||||
_expression = expression;
|
||||
}
|
||||
~BoundReturnStatement() final{
|
||||
delete _expression;
|
||||
}
|
||||
|
||||
BoundStatementKind GetKind() final{
|
||||
return BoundStatementKind ::Return;
|
||||
}
|
||||
|
||||
BoundExpression* GetExpression(){
|
||||
return _expression;
|
||||
}
|
||||
};
|
||||
|
||||
#include "BoundFunctionDeclarationStatement.hpp"
|
||||
|
||||
#endif //PORYGONLANG_BOUNDSTATEMENT_HPP
|
||||
|
||||
Reference in New Issue
Block a user