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 interpreter;
53pub mod ir;
54pub mod lexer;
55pub mod lint;
56pub mod lower;
57pub mod optimize;
58pub mod parser;
59pub mod plurality;
60pub mod span;
61pub mod stdlib;
62pub mod typeck;
63pub mod tree_sitter_support;
64
65#[cfg(feature = "jit")]
66pub mod codegen;
67
68#[cfg(feature = "llvm")]
69pub mod llvm_codegen;
70
71#[cfg(feature = "wasm")]
72pub mod wasm;
73
74#[cfg(feature = "protocol-core")]
75pub mod protocol;
76
77pub use ast::*;
78pub use diagnostic::{Diagnostic, DiagnosticBuilder, Diagnostics, FixSuggestion, Severity};
79pub use interpreter::{Evidence, Function, Interpreter, RuntimeError, Value};
80pub use ir::{IrDumpOptions, IrEvidence, IrFunction, IrModule, IrOperation, IrType};
81pub use lexer::{Lexer, Token};
82pub use lint::{
83 lint_file, lint_source, lint_source_with_config, lint_directory, lint_directory_parallel,
84 lint_and_fix, apply_fixes, watch_directory,
85 LintConfig, LintConfigFile, LintSettings, LintId, LintLevel, LintCategory, Linter,
86 DirectoryLintResult, FixResult, WatchConfig, WatchResult,
87 Suppression, parse_suppressions, LintStats,
89 SarifReport, generate_sarif, generate_sarif_for_directory,
90 explain_lint, list_lints,
91 Baseline, BaselineEntry, BaselineSummary, BaselineLintResult,
93 find_baseline, lint_with_baseline,
94 CliOverrides, config_with_overrides, lint_source_with_overrides,
95 LintCache, CacheEntry, CachedDiagnostic, CacheStats, IncrementalLintResult,
96 find_cache, lint_directory_incremental, CACHE_FILE,
97 LspSeverity, LspDiagnostic, LspRelatedInfo, LspCodeAction, LspTextEdit,
99 LspLintResult, LspServerState, lint_for_lsp,
100 GitIntegration, lint_changed_files, lint_changed_since, lint_files,
102 generate_pre_commit_hook, PRE_COMMIT_HOOK,
103 CustomRule, CustomPattern, CustomRulesFile, CustomRuleMatch, CustomRuleChecker,
105 lint_with_custom_rules,
106 IgnorePatterns, filter_ignored, collect_sigil_files_filtered, lint_directory_filtered,
108 LintReport, TrendData, TrendDirection, TrendSummary,
110 generate_html_report, save_html_report, CiFormat, generate_ci_annotations,
111};
112pub use lower::lower_source_file;
113pub use optimize::{optimize, OptLevel, OptStats, Optimizer};
114pub use parser::Parser;
115pub use span::Span;
116pub use stdlib::register_stdlib;
117pub use typeck::{EvidenceLevel, Type, TypeChecker, TypeError};
118
119#[cfg(feature = "jit")]
120pub use codegen::JitCompiler;
121
122#[cfg(feature = "llvm")]
123pub use llvm_codegen::llvm::{CompileMode, LlvmCompiler};
124
125#[cfg(feature = "wasm")]
126pub use wasm::WasmCompiler;