Implements variable assignment evaluation

This commit is contained in:
2019-05-29 14:55:03 +02:00
parent 6185f755a4
commit f6cf4d96dd
11 changed files with 104 additions and 8 deletions

View File

@@ -54,13 +54,19 @@ public:
};
class BoundScriptStatement : public BoundBlockStatement{
int _deepestScope;
public:
explicit BoundScriptStatement(vector<BoundStatement*> statements) : BoundBlockStatement(std::move(statements)){
explicit BoundScriptStatement(vector<BoundStatement*> statements, int deepestScope) : BoundBlockStatement(std::move(statements)){
_deepestScope = deepestScope;
}
BoundStatementKind GetKind() final{
return BoundStatementKind ::Script;
}
int GetDeepestScope(){
return _deepestScope;
}
};
class BoundExpressionStatement : public BoundStatement{
@@ -98,6 +104,14 @@ public:
BoundStatementKind GetKind() final{
return BoundStatementKind ::Assignment;
}
BoundVariableKey* GetKey(){
return _key;
}
BoundExpression* GetExpression(){
return _expression;
}
};
#endif //PORYGONLANG_BOUNDSTATEMENT_HPP