Time interpretation

This commit is contained in:
0x4261756D 2023-01-09 12:23:01 +01:00
parent ffdc54947b
commit df3e1b027f

View File

@ -4,6 +4,7 @@ use std::env;
use std::fs;
use std::iter::Peekable;
use std::process::exit;
use std::time::Instant;
#[derive(Debug, Clone, PartialEq)]
enum Token
@ -212,15 +213,17 @@ fn compile(file_content: &String, intrinsics: &HashMap<&str, (Vec<Datatype>, Vec
println!("---Done validating function calls---");
typecheck(&operations, &functions, &intrinsics, &arrays, debug)?;
println!("---Done typechecking---");
let start = Instant::now();
println!("---Starting to interpret the program---");
let output = if interpret
{
println!("---Starting to interpret the program---");
Some(interpret_program(&operations, &mut Vec::new(), &functions, &mut arrays, &intrinsics, debug)?)
}
else
{
None
};
println!("---Done after {:?}---", start.elapsed());
if !interpret
{
match generate_assembly_linux_x64(&operations, &functions, &intrinsics, &arrays, debug)