diff options
author | Aleksey Kladov <[email protected]> | 2018-07-30 13:25:52 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-07-30 13:25:52 +0100 |
commit | 333e140a50658151002c9287aa68855358bedd56 (patch) | |
tree | 21cd482ab080b00d5b93ebaf8e9096644bafa4b3 /src/bin/cli.rs | |
parent | d30a2e4fac9267066dc53d71c4695843f95e6269 (diff) |
Mior
Diffstat (limited to 'src/bin/cli.rs')
-rw-r--r-- | src/bin/cli.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bin/cli.rs b/src/bin/cli.rs new file mode 100644 index 000000000..9e513edb2 --- /dev/null +++ b/src/bin/cli.rs | |||
@@ -0,0 +1,20 @@ | |||
1 | extern crate libsyntax2; | ||
2 | |||
3 | use std::io::Read; | ||
4 | |||
5 | use libsyntax2::{ | ||
6 | parse, utils::dump_tree | ||
7 | }; | ||
8 | |||
9 | fn main() { | ||
10 | let text = read_input(); | ||
11 | let file = parse(text); | ||
12 | let tree = dump_tree(&file); | ||
13 | println!("{}", tree); | ||
14 | } | ||
15 | |||
16 | fn read_input() -> String { | ||
17 | let mut buff = String::new(); | ||
18 | ::std::io::stdin().read_to_string(&mut buff).unwrap(); | ||
19 | buff | ||
20 | } | ||