rust/src/bin/cli/parse.rs
2018-07-30 14:06:22 +03:00

20 lines
371 B
Rust

extern crate libsyntax2;
use std::io::Read;
use libsyntax2::{
parse, utils::dump_tree_green
};
fn main() {
let text = read_input();
let file = parse(text);
let tree = dump_tree_green(&file);
println!("{}", tree);
}
fn read_input() -> String {
let mut buff = String::new();
::std::io::stdin().read_to_string(&mut buff).unwrap();
buff
}