From 6cbe4d98095020451f5b427fecbc3f374812dec8 Mon Sep 17 00:00:00 2001
From: David Li
Date: Sat, 4 Nov 2017 19:20:25 -0400
Subject: Display a prompt in the REPL
---
src/main.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'src')
diff --git a/src/main.rs b/src/main.rs
index 2564011..8976597 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,13 +1,15 @@
pub mod ast;
pub mod taiga;
-use std::io::{self, BufRead};
+use std::io::{self, BufRead, Write};
fn main() {
let stdin = io::stdin();
let mut handle = stdin.lock();
loop {
let mut input = String::new();
+ print!("taiga> ");
+ io::stdout().flush().unwrap();
if let Ok(n) = handle.read_line(&mut input) {
if n == 0 { break; }
println!("{:?}", taiga::parse_Program(&input));
--
cgit v1.2.3