mirror of
https://github.com/MorizzG/rlox.git
synced 2026-02-04 03:44:47 +00:00
Chapter 17: Compiling Expressions done
This commit is contained in:
parent
b86985deaf
commit
1cca1494a4
20 changed files with 701 additions and 128 deletions
|
|
@ -22,7 +22,7 @@ fn main() {
|
|||
let cli_args = CliArgs::parse();
|
||||
|
||||
if cli_args.vm {
|
||||
use rlox2_vm::InterpretError;
|
||||
use rlox2_vm::LoxError;
|
||||
|
||||
let mut vm = rlox2_vm::VM::default();
|
||||
|
||||
|
|
@ -35,9 +35,9 @@ fn main() {
|
|||
if let Err(err) = rlox2_vm::run(&source, &mut vm) {
|
||||
eprintln!("{err}");
|
||||
match err {
|
||||
InterpretError::LexerError { .. } | InterpretError::CompileError { .. } => std::process::exit(65),
|
||||
InterpretError::RuntimeError { .. } => std::process::exit(70),
|
||||
InterpretError::Exit { exit_code } => std::process::exit(exit_code),
|
||||
LoxError::LexerError { .. } | LoxError::CompileError { .. } => std::process::exit(65),
|
||||
LoxError::RuntimeError { .. } => std::process::exit(70),
|
||||
LoxError::Exit { exit_code } => std::process::exit(exit_code),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue