flatten the instruction dispatch loop

This commit is contained in:
Mark Thom
2021-12-19 18:57:57 -07:00
parent 3db86f1e25
commit 955e1799c8
52 changed files with 14247 additions and 10021 deletions

View File

@@ -1,4 +1,5 @@
use static_string_indexing::index_static_strings;
use instructions_template::generate_instructions_rs;
use std::env;
use std::fs;
@@ -55,6 +56,20 @@ fn main() {
find_prolog_files(&mut libraries, "", &lib_path);
libraries.write_all(b"\n m\n };\n}\n").unwrap();
let instructions_path = Path::new("src/instructions.rs");
let mut instructions_file = File::create(&instructions_path).unwrap();
let quoted_output = generate_instructions_rs();
instructions_file
.write_all(quoted_output.to_string().as_bytes())
.unwrap();
Command::new("rustfmt")
.arg(instructions_path.as_os_str())
.spawn().unwrap()
.wait().unwrap();
let static_atoms_path = Path::new("src/static_atoms.rs");
let mut static_atoms_file = File::create(&static_atoms_path).unwrap();