diff options
| author | Arnaud Bailly <arnaud.bailly@iohk.io> | 2024-09-29 17:26:45 +0200 |
|---|---|---|
| committer | Arnaud Bailly <arnaud.bailly@iohk.io> | 2024-09-29 17:26:45 +0200 |
| commit | 96d6a0a2b562f81c5c14532487ce03a1a9065e6b (patch) | |
| tree | 0137b403fe0e8fdfbbe979f4081ae25cabdc96f2 /rust/src/main.rs | |
| parent | 9dcff1ea1b11f765f074d9b93e67bc6760f52049 (diff) | |
| download | lambda-nantes-96d6a0a2b562f81c5c14532487ce03a1a9065e6b.tar.gz | |
Implement sub-process based tester
Diffstat (limited to 'rust/src/main.rs')
| -rw-r--r-- | rust/src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rust/src/main.rs b/rust/src/main.rs index b0e8ed9..8d52c46 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -1,16 +1,18 @@ use std::{ env::args, - io::{stdin, stdout}, + io::{stdin, stdout, IsTerminal}, }; -use lambda::io::{eval_file, repl}; +use lambda::io::{batch_eval, eval_file, repl}; fn main() { if args().count() > 1 { for file in args().skip(1) { println!("{}", eval_file(&file)); } - } else { + } else if stdin().is_terminal() { repl(&mut stdin(), &mut stdout()); + } else { + batch_eval(&mut stdin(), &mut stdout()); } } |
