diff options
Diffstat (limited to 'bytecode/src/main.rs')
| -rw-r--r-- | bytecode/src/main.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bytecode/src/main.rs b/bytecode/src/main.rs new file mode 100644 index 0000000..b5a05ef --- /dev/null +++ b/bytecode/src/main.rs @@ -0,0 +1,13 @@ +mod bytecode; +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)); +} |
