diff options
author | Aleksey Kladov <[email protected]> | 2018-07-30 12:06:22 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-07-30 12:06:22 +0100 |
commit | 6983091d6d255bcfd17c4f8c14015d8abc77928d (patch) | |
tree | 153359a05ca3fd887b59fe47ee84a60be0e6dfaf /src/bin/cli/parse.rs | |
parent | 9a4957d143397256dc04f715660f758a65fcb9d1 (diff) |
Cleanup tools
Diffstat (limited to 'src/bin/cli/parse.rs')
-rw-r--r-- | src/bin/cli/parse.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bin/cli/parse.rs b/src/bin/cli/parse.rs new file mode 100644 index 000000000..563ea92f6 --- /dev/null +++ b/src/bin/cli/parse.rs | |||
@@ -0,0 +1,20 @@ | |||
1 | extern crate libsyntax2; | ||
2 | |||
3 | use std::io::Read; | ||
4 | |||
5 | use libsyntax2::{ | ||
6 | parse, utils::dump_tree_green | ||
7 | }; | ||
8 | |||
9 | fn main() { | ||
10 | let text = read_input(); | ||
11 | let file = parse(text); | ||
12 | let tree = dump_tree_green(&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 | } | ||