An interpreter for Thorsten Ball's Monkey programming langauge implemented in Rust.
Dev (unoptimized).
cargo build
Release (optimized).
cargo build --release
Run the REPL.
# run via cargo
cargo run
# or run the built binary
monkey-rs
Optionally configure the REPL to output tokens generated from lexing.
# run via cargo
cargo run -- --output tokens
# or run the built binary
monkey-rs --output tokens
Or output a formatted abstract syntax tree generated from parsing.
# run via cargo
cargo run -- --output ast
# or run the built binary
monkey-rs --output ast
Run all tests.
cargo test
Or run a single suite of tests.
cargo test built_in
cargo test eval
cargo test lexer
cargo test parser
cargo test scope
Most of the features defined in rustfmt.toml
require the Rust nightly channel. To apply, make sure nightly is installed in your toolchain, and run the following:
cargo +nightly fmt