mdl_monkey 1.0.0

A Rust implementation of the Monkey programming language from <https://interpreterbook.com/>.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate mdl_monkey;

use mdl_monkey::ast;

#[test]
fn ast_display() {
    let program = ast::Program {
        statements: vec![ast::Statement::Let(ast::LetStatement {
            name: "myVar".to_string(),
            value: ast::Expression::Identifier("anotherVar".to_string()),
        })],
    };

    assert_eq!(format!("{}", program), "let myVar = anotherVar;")
}