|
@@ -7,7 +7,7 @@ use crate::ast::{Constants, StatementType, Statements, Witnesses};
|
|
|
/// Version of the binary
|
|
/// Version of the binary
|
|
|
pub const BINARY_VERSION: u8 = 1;
|
|
pub const BINARY_VERSION: u8 = 1;
|
|
|
/// Magic bytes prepended to the binary
|
|
/// Magic bytes prepended to the binary
|
|
|
-pub const MAGIC_BYTES: [u8; 4] = [0xf3, 0x42, 0x69, BINARY_VERSION];
|
|
|
|
|
|
|
+pub const MAGIC_BYTES: [u8; 4] = [0x0b, 0x00, 0xb1, 0x35];
|
|
|
|
|
|
|
|
pub struct Compiler {
|
|
pub struct Compiler {
|
|
|
file: String,
|
|
file: String,
|
|
@@ -37,8 +37,9 @@ impl Compiler {
|
|
|
pub fn compile(&self) -> Vec<u8> {
|
|
pub fn compile(&self) -> Vec<u8> {
|
|
|
let mut bincode = vec![];
|
|
let mut bincode = vec![];
|
|
|
|
|
|
|
|
- // Write the magic bytes
|
|
|
|
|
|
|
+ // Write the magic bytes and version
|
|
|
bincode.extend_from_slice(&MAGIC_BYTES);
|
|
bincode.extend_from_slice(&MAGIC_BYTES);
|
|
|
|
|
+ bincode.push(BINARY_VERSION);
|
|
|
|
|
|
|
|
let mut stack_idx: u64 = 0;
|
|
let mut stack_idx: u64 = 0;
|
|
|
|
|
|