use crate::double::{Double, SignedDouble};
#[derive(Debug, Clone, Copy)]
pub(super) struct Environment {
pub config: Config,
pub counted_string: usize,
pub address_unit_bits: usize,
pub floored: bool,
pub max_char: usize,
pub max_d: SignedDouble,
pub max_n: isize,
pub max_u: usize,
pub max_ud: Double,
}
impl Default for Environment {
fn default() -> Self {
Self {
config: Config::default(),
counted_string: u8::MAX as usize,
address_unit_bits: u8::BITS as usize,
floored: false,
max_char: u8::MAX as usize,
max_d: SignedDouble::MAX,
max_n: isize::MAX,
max_u: usize::MAX,
max_ud: Double::MAX,
}
}
}
#[derive(Debug, Clone, Copy)]
pub struct Config {
pub hold: usize,
pub pad: usize,
pub return_stack_cells: usize,
pub stack_cells: usize,
}
impl Default for Config {
fn default() -> Self {
Self {
hold: 2 * (usize::BITS as usize) + 2,
pad: 84,
return_stack_cells: 64,
stack_cells: 64,
}
}
}