#ifndef TSL_BYTECODE_H #define TSL_BYTECODE_H #include "std/buffer.h" #include "std/string_view.h" #include "value.h" #include typedef uint8_t TslOpcodeType; typedef enum { TSL_OPCODE_LOAD_NUMBER, TSL_OPCODE_LOAD_BOOL, TSL_OPCODE_SETV } TslOpcode; typedef struct { TslBuffer buffer; } TslBytecodeWriter; typedef struct { double number; TslOpcodeType opcode; } TslInstructionType1; typedef struct { TslBool value; TslOpcodeType opcode; } TslInstructionType2; typedef struct { TslStringView key; TslOpcodeType opcode; } TslInstructionType3; void tsl_bytecode_writer_init(TslBytecodeWriter *self); void tsl_bytecode_writer_deinit(TslBytecodeWriter *self); int tsl_bytecode_writer_loadn(TslBytecodeWriter *self, double number); int tsl_bytecode_writer_loadb(TslBytecodeWriter *self, TslBool value); int tsl_bytecode_writer_setv(TslBytecodeWriter *self, TslStringView *key); #endif /* TSL_BYTECODE_H */