remove unused debug stuff
This commit is contained in:
parent
40a1a459b3
commit
d1483f9e61
3 changed files with 0 additions and 13 deletions
|
@ -553,11 +553,6 @@ fn compile_function(ast: Vec<ASTPart>, args: Option<Vec<String>>, registers: &mu
|
||||||
var.end = ops.len() - 1;
|
var.end = ops.len() - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println!("Operations: {:?}\n", ops);
|
|
||||||
println!("Registers: {:?}\n", registers);
|
|
||||||
println!("Variable IDs: {:?}", variables);
|
|
||||||
println!("Strings: {:?}", strings);
|
|
||||||
println!("==========================");
|
|
||||||
|
|
||||||
return Compiled {
|
return Compiled {
|
||||||
operations: ops,
|
operations: ops,
|
||||||
|
@ -656,7 +651,6 @@ fn compile_body(compiled: Compiled, fpos: &mut usize) -> Vec<u8> {
|
||||||
op_bin.push_str(&num_to_bin(0, 4));
|
op_bin.push_str(&num_to_bin(0, 4));
|
||||||
}
|
}
|
||||||
op_bin.push_str(&num_to_bin(0, 3));
|
op_bin.push_str(&num_to_bin(0, 3));
|
||||||
println!("{}", op_bin);
|
|
||||||
append_binary(&mut output, op_bin);
|
append_binary(&mut output, op_bin);
|
||||||
}
|
}
|
||||||
for addition in additional {
|
for addition in additional {
|
||||||
|
@ -679,7 +673,6 @@ pub fn compile(ast: Vec<ASTPart>) -> Vec<u8> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let compiled = compile_function(ast, None, &mut registers, &mut next_var_id);
|
let compiled = compile_function(ast, None, &mut registers, &mut next_var_id);
|
||||||
println!("Compiled: {:?}", compiled);
|
|
||||||
|
|
||||||
let mut output: Vec<u8> = vec![];
|
let mut output: Vec<u8> = vec![];
|
||||||
//doctype specifier
|
//doctype specifier
|
||||||
|
|
|
@ -128,7 +128,6 @@ fn main() {
|
||||||
let mut vm = Machine::new();
|
let mut vm = Machine::new();
|
||||||
vm.load(compiled);
|
vm.load(compiled);
|
||||||
vm.run();
|
vm.run();
|
||||||
println!("\n");
|
|
||||||
println!("Registers: {:?}", vm.registers);
|
println!("Registers: {:?}", vm.registers);
|
||||||
println!("Stack: {:?}", vm.stack);
|
println!("Stack: {:?}", vm.stack);
|
||||||
println!("Memory: {:?}", vm.memory);
|
println!("Memory: {:?}", vm.memory);
|
||||||
|
|
|
@ -352,16 +352,12 @@ fn load_func(data: Vec<u8>, offset: &mut usize) -> DecompiledFunction {
|
||||||
*offset += 4;
|
*offset += 4;
|
||||||
functions.insert(func_id, func_pos);
|
functions.insert(func_id, func_pos);
|
||||||
}
|
}
|
||||||
println!("Variables: {:?}", variables);
|
|
||||||
println!("Strings: {:?}", strings);
|
|
||||||
println!("Functions: {:?}", functions);
|
|
||||||
let mut body: Vec<DecompiledOperation> = Vec::new();
|
let mut body: Vec<DecompiledOperation> = Vec::new();
|
||||||
let instr_len: usize = read_be_num(&data[*offset..*offset + 4]);
|
let instr_len: usize = read_be_num(&data[*offset..*offset + 4]);
|
||||||
*offset += 4;
|
*offset += 4;
|
||||||
for _ in 0..instr_len {
|
for _ in 0..instr_len {
|
||||||
let op = read_bin(&data[*offset..*offset + 10]);
|
let op = read_bin(&data[*offset..*offset + 10]);
|
||||||
*offset += 10;
|
*offset += 10;
|
||||||
println!("{}", op);
|
|
||||||
let op_code = bin_to_num(op[0..5].to_string());
|
let op_code = bin_to_num(op[0..5].to_string());
|
||||||
let arg1 = bin_to_num(op[5..9].to_string());
|
let arg1 = bin_to_num(op[5..9].to_string());
|
||||||
let arg2 = bin_to_snum(op[9..73].to_string());
|
let arg2 = bin_to_snum(op[9..73].to_string());
|
||||||
|
@ -417,7 +413,6 @@ impl Machine {
|
||||||
let func = load_func(data.clone(), &mut offset);
|
let func = load_func(data.clone(), &mut offset);
|
||||||
self.functions.push(func);
|
self.functions.push(func);
|
||||||
}
|
}
|
||||||
println!("Decompiled: {:?}", self.functions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(&mut self) {
|
pub fn run(&mut self) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue