Support for explicit casting
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-08-18 14:32:14 +02:00
parent 1d72e2eccd
commit e939920e5c
8 changed files with 173 additions and 105 deletions

View File

@@ -28,7 +28,7 @@ namespace Porygon::Binder {
NumericalTable,
Table,
Require,
ImplicitCast,
Cast,
};
class BoundExpression {
@@ -333,10 +333,10 @@ namespace Porygon::Binder {
}
};
class BoundImplicitCastExpression : public BoundExpression {
class BoundCastExpression : public BoundExpression {
const BoundExpression* _expression;
public:
BoundImplicitCastExpression(BoundExpression* expression, shared_ptr<const ScriptType> castType)
BoundCastExpression(BoundExpression* expression, shared_ptr<const ScriptType> castType)
: BoundExpression(expression->GetStartPosition(), expression->GetLength(), castType),
_expression(expression)
{}
@@ -345,13 +345,13 @@ namespace Porygon::Binder {
return _expression;
}
~BoundImplicitCastExpression() final {
~BoundCastExpression() final {
delete _expression;
}
[[nodiscard]]
inline BoundExpressionKind GetKind() const final {
return BoundExpressionKind::ImplicitCast;
return BoundExpressionKind::Cast;
}
};