Implements support for functions with the same name, but different parameters
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-29 19:59:42 +02:00
parent 24c560b52d
commit db2d731b06
23 changed files with 362 additions and 204 deletions

View File

@@ -7,6 +7,7 @@
#include "../../ScriptType.hpp"
#include "../BoundOperators.hpp"
#include "../BoundVariables/BoundVariableKey.hpp"
#include "../../FunctionScriptType.hpp"
using namespace std;
@@ -227,36 +228,6 @@ namespace Porygon::Binder {
}
};
class BoundFunctionCallExpression : public BoundExpression {
const BoundExpression *_functionExpression;
const vector<BoundExpression *> _parameters;
public:
BoundFunctionCallExpression(BoundExpression *functionExpression, vector<BoundExpression *> parameters,
shared_ptr<ScriptType> result,
unsigned int start, unsigned int length)
: BoundExpression(start, length, std::move(result)), _functionExpression(functionExpression),
_parameters(std::move(parameters)) {}
~BoundFunctionCallExpression() final {
delete _functionExpression;
for (auto p : _parameters) {
delete p;
}
}
const BoundExpressionKind GetKind() const final {
return BoundExpressionKind::FunctionCall;
}
const BoundExpression *GetFunctionExpression() const {
return _functionExpression;
}
const vector<BoundExpression *> *GetParameters() const {
return &_parameters;
}
};
class BoundIndexExpression : public BoundExpression {
const BoundExpression *_indexableExpression;
const BoundExpression *_indexExpression;