mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* Support default args in funcref calls - Simplify BFunctionRef by using funcref index - Emit default args when visiting function reference * Move default args gen to second-pass visit * Better error message on param count errors * Check for constructor in MTH_NEW * Address self-review comments - Update code comments * Introduce ResourceManager to pol testsuite - Create a new class-based resource manager for deleting resources (item NPCs, multis) after each test. - Migrate house_set_multiid test to use new ResourceManager. * Move resource cleanup
33 lines
993 B
C++
33 lines
993 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
|
|
class FunctionReferenceDescriptor
|
|
{
|
|
public:
|
|
FunctionReferenceDescriptor( unsigned address, int parameter_count, int capture_count,
|
|
bool is_variadic, unsigned class_index, bool is_constructor,
|
|
std::vector<unsigned> default_parameter_addresses );
|
|
unsigned address() const;
|
|
int parameter_count() const;
|
|
int capture_count() const;
|
|
bool is_variadic() const;
|
|
unsigned class_index() const;
|
|
bool is_constructor() const;
|
|
const std::vector<unsigned>& default_parameter_addresses() const;
|
|
|
|
private:
|
|
unsigned address_;
|
|
int parameter_count_;
|
|
int capture_count_;
|
|
bool is_variadic_;
|
|
unsigned class_index_; // Has value for methods and constructors, NOT static functions
|
|
bool is_constructor_; // Must be `true` to call with MTH_NEW
|
|
std::vector<unsigned> default_parameter_addresses_;
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|