aboutsummaryrefslogtreecommitdiffstats
path: root/bytecode/src/main.rs
blob: 683ff26a567a8a48b0959a0f9ec5220237e4d7d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
mod bytecode;
mod data;
mod encoding;
mod heap;

use std::io::Read;

fn main() {
    let mut buf = Vec::new();
    std::io::stdin().lock().read_to_end(&mut buf).unwrap();
    let prog = encoding::decode(&buf).unwrap();
    let exit_code = bytecode::eval(&prog).unwrap();
    std::process::exit(i32::from(exit_code));
}