summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index bd4659b..2564011 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,19 @@
pub mod ast;
pub mod taiga;
+use std::io::{self, BufRead};
+
fn main() {
- println!("{:?}", taiga::parse_Program("(3 + 5) * 7"));
+ let stdin = io::stdin();
+ let mut handle = stdin.lock();
+ loop {
+ let mut input = String::new();
+ if let Ok(n) = handle.read_line(&mut input) {
+ if n == 0 { break; }
+ println!("{:?}", taiga::parse_Program(&input));
+ }
+ else {
+ break;
+ }
+ }
}