Skip to content

Interpreter for the Monkey programming language implemented in Rust.

Notifications You must be signed in to change notification settings

j-arens/monkey-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An interpreter for Thorsten Ball's Monkey programming langauge implemented in Rust.


Building

Dev (unoptimized).

cargo build

Release (optimized).

cargo build --release

Usage

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

Testing

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

Formatting

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

About

Interpreter for the Monkey programming language implemented in Rust.

Topics

Resources

Stars

Watchers

Forks

Languages