

#ifndef PORYGONLANG_BOUNDTABLEEXPRESSION_HPP
#define PORYGONLANG_BOUNDTABLEEXPRESSION_HPP

#include <utility>
#include "../BoundStatements/BoundStatement.hpp"

namespace Porygon::Binder {
    class BoundTableExpression : public BoundExpression {
        const BoundBlockStatement *_block;
    public:
        BoundTableExpression(BoundBlockStatement *block, shared_ptr<ScriptType> type, unsigned int start,
                             unsigned int length)
                : BoundExpression(start, length, std::move(type)) {
            _block = block;
        }

        ~BoundTableExpression() final {
            delete _block;
        }

        [[nodiscard]]
        inline BoundExpressionKind GetKind() const final {
            return BoundExpressionKind::Table;
        }

        [[nodiscard]]
        inline const BoundBlockStatement *GetBlock() const {
            return _block;
        }
    };
}

#include "BoundExpression.hpp"

#endif //PORYGONLANG_BOUNDTABLEEXPRESSION_HPP
