1#[macro_use]
4mod macros;
5
6pub mod tape;
7pub mod value;
8pub mod walue;
9
10mod number;
11
12pub use number::{q16, q32};
13
14pub type Error = std::io::Error;
16
17#[derive(Debug)]
19pub struct ErrorWithSource {
20 pub description: String,
21 pub source: Error,
22}
23
24pub type Result<T> = std::io::Result<T>;
26
27impl std::fmt::Display for ErrorWithSource {
28 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29 write!(formatter, "{}, due to {}", self.description, self.source)
30 }
31}
32
33impl std::error::Error for ErrorWithSource {
34 #[inline]
35 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
36 Some(&self.source)
37 }
38}