cl-repl: Don't print ConValue::Empty return values
This commit is contained in:
parent
5db77db6b8
commit
86c4da0689
@ -1,5 +1,6 @@
|
|||||||
use crate::{ansi, ctx};
|
use crate::{ansi, ctx};
|
||||||
use cl_ast::Stmt;
|
use cl_ast::Stmt;
|
||||||
|
use cl_interpret::convalue::ConValue;
|
||||||
use cl_lexer::Lexer;
|
use cl_lexer::Lexer;
|
||||||
use cl_parser::Parser;
|
use cl_parser::Parser;
|
||||||
use repline::{error::ReplResult, prebaked::*};
|
use repline::{error::ReplResult, prebaked::*};
|
||||||
@ -48,6 +49,7 @@ pub fn run(ctx: &mut ctx::Context) -> ReplResult<()> {
|
|||||||
|
|
||||||
print!("{}", ansi::OUTPUT);
|
print!("{}", ansi::OUTPUT);
|
||||||
match ctx.run(&code) {
|
match ctx.run(&code) {
|
||||||
|
Ok(ConValue::Empty) => print!("{}", ansi::RESET),
|
||||||
Ok(v) => println!("{}{v}", ansi::RESET),
|
Ok(v) => println!("{}{v}", ansi::RESET),
|
||||||
Err(e) => println!("{}! > {e}{}", ansi::RED, ansi::RESET),
|
Err(e) => println!("{}! > {e}{}", ansi::RED, ansi::RESET),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user