#![allow(clippy::result_large_err)]
#![allow(clippy::mutable_key_type)]
#[cfg(test)]
mod tests;
pub type Int = i64;
mod expression;
pub use expression::Expression;
pub use expression::eval;
mod env;
pub use env::*;
mod errors;
pub use errors::LmError;
pub use errors::error_runtime::*;
pub use errors::error_syntax::*;
mod parser;
pub use parser::*;
mod tokens;
pub use tokens::{Token, TokenKind};
mod tokenizer;
pub use tokenizer::*;
pub mod repl;
pub mod runtime;
pub use runtime::{check, parse, parse_and_eval, parse_with_mode};
pub mod syntax;
pub use syntax::highlight;
pub mod ai;
pub mod cmdhelper;
pub mod prompt;
pub mod childman;
pub mod editor;
pub mod utils;
pub mod completion;
pub mod jobman;
pub mod modman;
pub mod libs;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
use std::cell::RefCell;
thread_local! {
static PRINT_DIRECT: RefCell<bool> = const {RefCell::new(true)};
static CFM_CONFIG: RefCell<Option<bool>> = const {RefCell::new(None)};
static STRICT_ENABLED: RefCell<bool> = const {RefCell::new(false)};
static MAX_RUNTIME_RECURSION: RefCell<usize> = const {RefCell::new(800)};
static MAX_SYNTAX_RECURSION: RefCell<usize> = const {RefCell::new(100)};
static MAX_USEMODE_RECURSION: RefCell<usize> = const {RefCell::new(100)};
}
pub fn with_print_direct<R>(f: impl FnOnce(bool) -> R) -> R {
PRINT_DIRECT.with(|v| f(*v.borrow()))
}
pub fn set_print_direct(value: bool) {
PRINT_DIRECT.with(|v| *v.borrow_mut() = value);
}
pub fn set_cfm_enabled(value: Option<bool>) {
CFM_CONFIG.with(|v| *v.borrow_mut() = value);
}
pub fn with_cfm_config<R>(f: impl FnOnce(Option<bool>) -> R) -> R {
CFM_CONFIG.with(|v| f(*v.borrow()))
}
pub fn set_strict_enabled(value: bool) {
STRICT_ENABLED.with(|v| *v.borrow_mut() = value);
}