2024-08-19 19:57:31 +02:00
|
|
|
#include "ClassDeclarationRegistrar.h"
|
|
|
|
|
|
|
|
|
|
#include "bscript/compiler/representation/ClassDescriptor.h"
|
|
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
class MethodDescriptor;
|
|
|
|
|
|
|
|
|
|
ClassDeclarationRegistrar::ClassDeclarationRegistrar() = default;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ClassDeclarationRegistrar::register_class(
|
2024-09-06 11:11:34 +02:00
|
|
|
unsigned class_name_offset, unsigned constructor_function_reference_index,
|
|
|
|
|
const std::vector<ConstructorDescriptor>& constructors,
|
2024-08-19 19:57:31 +02:00
|
|
|
const std::vector<MethodDescriptor>& method_descriptors )
|
|
|
|
|
{
|
2024-09-06 11:11:34 +02:00
|
|
|
descriptors.emplace_back( class_name_offset, constructor_function_reference_index, constructors,
|
|
|
|
|
method_descriptors );
|
2024-08-19 19:57:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<ClassDescriptor> ClassDeclarationRegistrar::take_descriptors()
|
|
|
|
|
{
|
|
|
|
|
return std::move( descriptors );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|