mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Set up assemble stub
This commit is contained in:
@@ -12,7 +12,22 @@ pub fn command(args: &Vec<String>) {
|
||||
return;
|
||||
}
|
||||
|
||||
println!("TODO: assemble file {}", args[2]);
|
||||
let read_result = std::fs::read_to_string(&args[2]);
|
||||
|
||||
if read_result.is_err() {
|
||||
println!("Failed to read file {}", args[2]);
|
||||
return;
|
||||
}
|
||||
|
||||
let content = read_result.expect("");
|
||||
let output_filename = "out.vsb";
|
||||
|
||||
let write_result = std::fs::write(output_filename, assemble(&content));
|
||||
|
||||
if write_result.is_err() {
|
||||
println!("Failed to write file {}", output_filename);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
fn show_help() {
|
||||
@@ -22,3 +37,11 @@ fn show_help() {
|
||||
println!("USAGE:");
|
||||
println!(" vstc assemble <file>");
|
||||
}
|
||||
|
||||
fn assemble(content: &String) -> std::vec::Vec<u8> {
|
||||
let mut output: Vec<u8> = Vec::new();
|
||||
|
||||
// TODO: Assemble content into output
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user