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