1use std::sync::atomic::{AtomicBool, Ordering};
14
15static VERBOSE: AtomicBool = AtomicBool::new(false);
18
19pub fn set_verbose(enabled: bool) {
21 VERBOSE.store(enabled, Ordering::SeqCst);
22}
23
24pub fn is_verbose() -> bool {
26 VERBOSE.load(Ordering::SeqCst)
27}
28
29#[macro_export]
31macro_rules! sigil_debug {
32 ($($arg:tt)*) => {
33 if $crate::is_verbose() {
34 eprintln!($($arg)*);
35 }
36 };
37}
38
39#[macro_export]
41macro_rules! sigil_warn {
42 ($($arg:tt)*) => {
43 if $crate::is_verbose() {
44 eprintln!($($arg)*);
45 }
46 };
47}
48
49pub mod ast;
50pub mod diagnostic;
51pub mod ffi;
52pub mod fmt;
53pub mod interpreter;
54pub mod ir;
55pub mod lexer;
56pub mod lint;
57pub mod lower;
58pub mod optimize;
59pub mod parser;
60pub mod plurality;
61pub mod span;
62pub mod stdlib;
63pub mod tome;
64pub mod tree_sitter_support;
65pub mod typeck;
66
67#[cfg(feature = "jit")]
68pub mod codegen;
69
70#[cfg(feature = "llvm")]
71pub mod llvm_codegen;
72
73#[cfg(feature = "wasm")]
74pub mod wasm;
75
76#[cfg(feature = "protocol-core")]
77pub mod protocol;
78
79#[cfg(feature = "lsp")]
80pub mod lsp;
81
82pub use ast::*;
83pub use diagnostic::{Diagnostic, DiagnosticBuilder, Diagnostics, FixSuggestion, Severity};
84pub use interpreter::{Evidence, Function, Interpreter, RuntimeError, Value};
85pub use ir::{IrDumpOptions, IrEvidence, IrFunction, IrModule, IrOperation, IrType};
86pub use lexer::{Lexer, Token};
87pub use lint::{
88 apply_fixes,
89 collect_sigil_files_filtered,
90 config_with_overrides,
91 explain_lint,
92 filter_ignored,
93 find_baseline,
94 find_cache,
95 generate_ci_annotations,
96 generate_html_report,
97 generate_pre_commit_hook,
98 generate_sarif,
99 generate_sarif_for_directory,
100 lint_and_fix,
101 lint_changed_files,
102 lint_changed_since,
103 lint_directory,
104 lint_directory_filtered,
105 lint_directory_incremental,
106 lint_directory_parallel,
107 lint_file,
108 lint_files,
109 lint_for_lsp,
110 lint_source,
111 lint_source_with_config,
112 lint_source_with_overrides,
113 lint_with_baseline,
114 lint_with_custom_rules,
115 list_lints,
116 parse_suppressions,
117 save_html_report,
118 watch_directory,
119 Baseline,
121 BaselineEntry,
122 BaselineLintResult,
123 BaselineSummary,
124 CacheEntry,
125 CacheStats,
126 CachedDiagnostic,
127 CiFormat,
128 CliOverrides,
129 CustomPattern,
130 CustomRule,
132 CustomRuleChecker,
133 CustomRuleMatch,
134 CustomRulesFile,
135 DirectoryLintResult,
136 FixResult,
137 GitIntegration,
139 IgnorePatterns,
141 IncrementalLintResult,
142 LintCache,
143 LintCategory,
144 LintConfig,
145 LintConfigFile,
146 LintId,
147 LintLevel,
148 LintReport,
150 LintSettings,
151 LintStats,
152 Linter,
153 LspCodeAction,
154 LspDiagnostic,
155 LspLintResult,
156 LspRelatedInfo,
157 LspServerState,
158 LspSeverity,
160 LspTextEdit,
161 SarifReport,
162 Suppression,
164 TrendData,
165 TrendDirection,
166 TrendSummary,
167 WatchConfig,
168 WatchResult,
169 CACHE_FILE,
170 PRE_COMMIT_HOOK,
171};
172pub use lower::lower_source_file;
173pub use optimize::{optimize, OptLevel, OptStats, Optimizer};
174pub use parser::Parser;
175pub use span::Span;
176pub use stdlib::register_stdlib;
177pub use typeck::{EvidenceLevel, Type, TypeChecker, TypeError};
178
179#[cfg(feature = "jit")]
180pub use codegen::JitCompiler;
181
182#[cfg(feature = "llvm")]
183pub use llvm_codegen::llvm::{CompileMode, LlvmCompiler};
184
185#[cfg(feature = "wasm")]
186pub use wasm::WasmCompiler;