This commit is contained in:
Andre Wagner
2026-05-16 15:31:33 -05:00
parent df8edb549d
commit 5c885654af
5 changed files with 64 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ typedef enum {
T_ERR_TABLE_KEY_NOT_FOUND = -20,
T_ERR_ASSEMBLER_SYNTAX_ERROR = -30,
T_ERR_BYTECODE_TOO_SMALL = -40, T_ERR_BYTECODE_INVALID_MAGIC = -41,
T_ERR_TYPE_UNEXPECTED = -50, T_ERR_INVALID_OPCODE = -51, T_ERR_EXPR_INCORRECT_TYPES = -52,
T_ERR_TYPE_UNEXPECTED = -50, T_ERR_INVALID_OPCODE = -51, T_ERR_EXPR_INCORRECT_TYPES = -52, T_ERR_VALUE_OUT_OF_RANGE = -53,
} TYC_RESULT;
typedef enum {
@@ -39,6 +39,7 @@ TYC_RESULT tyc_call(TycheVM* t, uint16_t n_pars);
// stack manipulation and query
size_t tyc_stack_size(TycheVM* T);
void tyc_pushnil(TycheVM* T);
void tyc_pushinteger(TycheVM* T, int32_t value);
TYC_RESULT tyc_type(TycheVM* T, int idx, TYC_TYPE* type);
TYC_RESULT tyc_tointeger(TycheVM* T, int idx, int32_t* value);