Better handling of casting
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:
@@ -28,6 +28,7 @@ namespace Porygon::Binder {
|
||||
NumericalTable,
|
||||
Table,
|
||||
Require,
|
||||
ImplicitCast,
|
||||
};
|
||||
|
||||
class BoundExpression {
|
||||
@@ -332,6 +333,28 @@ namespace Porygon::Binder {
|
||||
}
|
||||
};
|
||||
|
||||
class BoundImplicitCastExpression : public BoundExpression {
|
||||
const BoundExpression* _expression;
|
||||
public:
|
||||
BoundImplicitCastExpression(BoundExpression* expression, shared_ptr<const ScriptType> castType)
|
||||
: BoundExpression(expression->GetStartPosition(), expression->GetLength(), castType),
|
||||
_expression(expression)
|
||||
{}
|
||||
|
||||
const BoundExpression* GetExpression() const{
|
||||
return _expression;
|
||||
}
|
||||
|
||||
~BoundImplicitCastExpression() final {
|
||||
delete _expression;
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline BoundExpressionKind GetKind() const final {
|
||||
return BoundExpressionKind::ImplicitCast;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //PORYGONLANG_BOUNDEXPRESSION_HPP
|
||||
|
||||
Reference in New Issue
Block a user