Skip to content

MoonLiveBuiltins

Source: MoonLiveBuiltins.h

Builtin

struct Builtin
src/core/moonlive/MoonLiveBuiltins.h:89

Public Attributes

const char * name = nullptr

uint8_t argc = 0

bool returns = false

BuiltinKind kind = BuiltinKind::Call

HostCallFn fn = nullptr

InlineOp inlineOp {}

uint8_t byRef = 0

uint8_t byStr = 0

uint8_t fixedArgs = 0

bool fixedReturn = false

BuiltinTable

struct BuiltinTable
src/core/moonlive/MoonLiveBuiltins.h:138

Public Attributes

Builtin items

uint8_t count = 0

bool overflowed = false

Public Methods

inline bool add(const Builtin & b)

inline bool full() const : True when a registration was dropped for lack of room.

inline uint8_t registered() const : Every registered name, for the overflow diagnostic. Not used on any hot path.

inline const Builtin * find(const char * name, size_t len) const

Public Static Attributes

constexpr uint8_t kMax = 96

SysVar

struct SysVar
src/core/moonlive/MoonLiveBuiltins.h:292

Public Attributes

const char * name = nullptr

SysVarKind kind = SysVarKind::Arena

uint8_t where = 0

SysVarTable

struct SysVarTable
src/core/moonlive/MoonLiveBuiltins.h:300

The system variables one host domain defines.

Same shape and lookup as BuiltinTable: a host hands the compiler both, and the compiler resolves names against them without knowing the domain.

Public Attributes

SysVar items

uint8_t count = 0

Public Methods

inline bool add(const SysVar & v)

inline const SysVar * find(const char * name, size_t len) const

Public Static Attributes

constexpr uint8_t kMax = kMaxSysVars