Skip to main content

lox_interpreter/
lib.rs

1//! # Crusty Lox Interpreter
2//!
3//! A complete implementation of the Lox programming language interpreter in Rust,
4//! based on Robert Nystrom's "Crafting Interpreters" book.
5//!
6//! ## Features
7//!
8//! - Full Lox language support (variables, control flow, expressions)
9//! - Interactive REPL mode
10//! - File execution
11//! - Comprehensive error reporting
12//! - Lexical scoping
13//!
14//! ## Example
15//!
16//! ```rust,ignore
17//! use crusty::{Interpreter, Source};
18//!
19//! let mut interpreter = Interpreter::new();
20//! let source = Source::new(r#"
21//!     var x = 42;
22//!     print x;
23//! "#.to_string());
24//!
25//! // interpreter.evaluate(source); // Would execute the code
26//! ```
27
28// Re-export public API for library usage
29pub use ast::*;
30pub use environ::*;
31pub use error::*;
32pub use evaluate::*;
33pub use parser::*;
34pub use reader::*;
35pub use tokenize::*;
36
37// Include all modules
38pub mod ast;
39pub mod environ;
40pub mod error;
41pub mod evaluate;
42pub mod parser;
43pub mod reader;
44pub mod tokenize;
45pub mod tokenizer;