#[allow(non_snake_case)]
#[path="base.s.rs"]
pub mod s;
#[cfg_attr(doc, doc(inline, cfg(all())))]
#[cfg(not(have_std))]
pub use no_std::handle_panic;
#[cfg(have_std)]
use crate::{Sexp, SExt, R::Rchar};
#[cfg_attr(doc, doc(cfg(all())))]
#[cfg(have_std)]
pub fn handle_panic<R, F: FnOnce() -> R + std::panic::UnwindSafe>(f: F) -> R {
let thing:Sexp<Rchar> = match std::panic::catch_unwind(f) {
Ok(ret) => return ret,
Err(info) => match info.downcast::<String>() {
Ok(string)=>Sexp::raw_from(format!("{:?}",string)),
Err(info)=>Sexp::raw_from(format!("payload type: {} (panic with no information)",core::any::type_name_of_val(&info)).as_str())
}.into()
};
unsafe {thing.error()}
}
#[cfg(not(have_std))]
#[cfg_attr(doc, doc(cfg(not(have_std))))]
#[path = "base.no-std.rs"]
pub mod no_std;