rewrite VM to support reentry (WIP)
This commit is contained in:
+6
-7
@@ -40,19 +40,18 @@ struct ExprSource {
|
||||
file: Option<PathBuf>,
|
||||
}
|
||||
|
||||
fn run_compile(_runtime: &mut Runtime, src: ExprSource, _silent: bool) -> Result<()> {
|
||||
let _src = if let Some(expr) = src.expr {
|
||||
fn run_compile(runtime: &mut Runtime, src: ExprSource, silent: bool) -> Result<()> {
|
||||
let src = if let Some(expr) = src.expr {
|
||||
Source::new_eval(expr)?
|
||||
} else if let Some(file) = src.file {
|
||||
Source::new_file(file)?
|
||||
} else {
|
||||
unreachable!()
|
||||
};
|
||||
todo!()
|
||||
/* match runtime.compile_bytecode(src) {
|
||||
Ok(compiled) => {
|
||||
match runtime.compile_bytecode(src) {
|
||||
Ok(ip) => {
|
||||
if !silent {
|
||||
println!("{}", runtime.disassemble_colored(&compiled));
|
||||
println!("{}", runtime.disassemble_colored(ip));
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
@@ -60,7 +59,7 @@ fn run_compile(_runtime: &mut Runtime, src: ExprSource, _silent: bool) -> Result
|
||||
exit(1);
|
||||
}
|
||||
};
|
||||
Ok(()) */
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_eval(runtime: &mut Runtime, src: ExprSource) -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user