mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-16 10:25:02 +01:00
fix stack things and underscore and more
This commit is contained in:
parent
e9cad4b49e
commit
d715213731
10 changed files with 113 additions and 31 deletions
|
|
@ -33,10 +33,15 @@ type HashSet<T> = rustc_hash::FxHashSet<T>;
|
|||
|
||||
pub struct Config<'io> {
|
||||
pub debug: bool,
|
||||
pub step: bool,
|
||||
pub stdout: &'io mut dyn Write,
|
||||
}
|
||||
|
||||
pub fn run_program(program: &str, cfg: &mut Config) {
|
||||
if cfg.debug {
|
||||
eprintln!("Config: debug: {}, step: {}", cfg.debug, cfg.step);
|
||||
}
|
||||
|
||||
let ast_alloc = Bump::new();
|
||||
|
||||
// SAFETY: I will try to 🥺
|
||||
|
|
@ -73,7 +78,7 @@ fn process_ast(program: &str, ast: &Program, mut runtime: RtAlloc, cfg: &mut Con
|
|||
}
|
||||
}
|
||||
|
||||
let result = vm::execute(&code, runtime, cfg.stdout);
|
||||
let result = vm::execute(code, runtime, cfg);
|
||||
if let Err(result) = result {
|
||||
eprintln!("error: {}", result);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue