This commit is contained in:
2026-04-27 14:02:48 -05:00
parent 84fca2a615
commit 566f210f3f
4 changed files with 88 additions and 2 deletions

View File

@@ -8,8 +8,8 @@ namespace tyche {
class Bytecode {
public:
Bytecode(std::vector<uint8_t> data);
Bytecode(BytecodePrototype const& bp);
explicit Bytecode(std::vector<uint8_t> data) : byte_array_(std::move(data)) {}
explicit Bytecode(BytecodePrototype const& bp);
[[nodiscard]] uint32_t n_constants() const;
[[nodiscard]] uint32_t n_functions() const;
@@ -29,6 +29,8 @@ public:
private:
ByteArray byte_array_;
static constexpr uint8_t VERSION = 1;
static constexpr uint32_t MAGIC = 0x74b3c138;
};
}