sigil_parser/
lib.rs

1//! Sigil Parser Library
2//!
3//! A polysynthetic programming language with evidentiality types.
4//!
5//! This crate provides:
6//! - Lexer and parser for Sigil source code
7//! - Tree-walking interpreter for development/debugging
8//! - JIT compiler using Cranelift for native performance
9//! - Comprehensive optimization passes (O0-O3)
10//! - Rich diagnostic reporting with colored output
11//! - AI-facing IR for tooling and agent integration
12
13pub mod ast;
14pub mod diagnostic;
15pub mod ffi;
16pub mod interpreter;
17pub mod ir;
18pub mod lexer;
19pub mod lower;
20pub mod optimize;
21pub mod parser;
22pub mod span;
23pub mod stdlib;
24pub mod typeck;
25
26#[cfg(feature = "jit")]
27pub mod codegen;
28
29#[cfg(feature = "llvm")]
30pub mod llvm_codegen;
31
32#[cfg(feature = "protocol-core")]
33pub mod protocol;
34
35pub use ast::*;
36pub use diagnostic::{Diagnostic, DiagnosticBuilder, Diagnostics, FixSuggestion, Severity};
37pub use interpreter::{Evidence, Function, Interpreter, RuntimeError, Value};
38pub use ir::{IrDumpOptions, IrEvidence, IrFunction, IrModule, IrOperation, IrType};
39pub use lexer::{Lexer, Token};
40pub use lower::lower_source_file;
41pub use optimize::{optimize, OptLevel, OptStats, Optimizer};
42pub use parser::Parser;
43pub use span::Span;
44pub use stdlib::register_stdlib;
45pub use typeck::{EvidenceLevel, Type, TypeChecker, TypeError};
46
47#[cfg(feature = "jit")]
48pub use codegen::JitCompiler;
49
50#[cfg(feature = "llvm")]
51pub use llvm_codegen::llvm::{CompileMode, LlvmCompiler};