1
0
Fork 0
forked from koniifer/ableos
ableos-framebuffer/hbasm/src/main.rs

22 lines
471 B
Rust
Raw Normal View History

use std::{
error::Error,
io::{stdin, stdout, Read, Write},
};
fn main() -> Result<(), Box<dyn Error>> {
let mut code = String::new();
stdin().read_to_string(&mut code)?;
let mut buf = vec![];
2023-07-10 16:18:23 -05:00
if let Err(e) = hbasm::text::assembly(&code, &mut buf) {
eprintln!(
"Error {:?} at {:?} (`{}`)",
e.kind,
e.span.clone(),
&code[e.span],
);
}
stdout().write_all(&buf)?;
Ok(())
}