chloro_core/lib.rs
1/// chloro-core: minimal Rust code formatter
2pub mod debug;
3pub mod formatter;
4
5pub use formatter::format_source;
6
7/// Macro for debug output in chloro.
8///
9/// Prints to stderr only if debug output is enabled via the atomic flag (tests do this using ctor)
10/// or the `CHLORO_DEBUG` environment variable at startup.
11#[macro_export]
12macro_rules! chloro_debug {
13 ($($arg:tt)*) => {
14 if $crate::debug::is_enabled() {
15 eprintln!("[CHLORO DEBUG] {}", format!($($arg)*));
16 }
17 };
18}
19
20#[cfg(test)]
21mod tests;