1use compiler::CompileError;
2use thiserror::Error;
3use vm::RuntimeError;
4
5pub mod chunk;
6pub mod compiler;
7pub mod debug;
8pub mod value;
9pub mod vm;
10
11#[cfg(not(feature = "debug"))]
12pub const DEBUG: bool = false;
13#[cfg(feature = "debug")]
14pub const DEBUG: bool = true;
15
16#[cfg(not(feature = "super_debug"))]
17pub const SUPER_DEBUG: bool = false;
18#[cfg(feature = "super_debug")]
19pub const SUPER_DEBUG: bool = true;
20
21pub type InterpretResult<T> = Result<T, InterpretError>;
22
23#[derive(Error, Debug)]
24pub enum InterpretError {
25 #[error("An unknown error has occurred.")]
26 Unknown,
27 #[error("An error occurred during compilation:\n{0}")]
28 CompileError(#[from] CompileError),
29 #[error("An error occurred during execution:\n{0}")]
30 RuntimeError(#[from] RuntimeError),
31}