do functions work finally maybe

This commit is contained in:
nora 2022-04-24 19:53:58 +02:00
parent ebd3dd8d82
commit 237fb34d97
12 changed files with 132 additions and 86 deletions

View file

@ -1,4 +1,4 @@
#![deny(clippy::disallowed_type)]
#![deny(clippy::disallowed_types)]
mod ast;
mod bytecode;
@ -10,14 +10,14 @@ mod parse;
mod util;
mod vm;
use crate::ast::Program;
use crate::gc::RtAlloc;
use std::io::Write;
pub use bumpalo::Bump;
pub use lex::*;
pub use parse::*;
use crate::{ast::Program, gc::RtAlloc};
#[cfg(not(feature = "fxhash"))]
#[allow(clippy::disallowed_types)]
type HashMap<K, V> = std::collections::HashMap<K, V>;
@ -73,8 +73,8 @@ fn process_ast(program: &str, ast: &Program, mut runtime: RtAlloc, cfg: &mut Con
}
let result = vm::execute(code, runtime, cfg);
if let Err(result) = result {
eprintln!("error: {}", result);
if let Err(msg) = result {
eprintln!("error: {msg}");
}
}
Err(err) => errors::display_error(program, err),