From 50c68f0cdf36983e61691e4a229a6d01fd0b5f78 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 28 Apr 2024 16:33:31 +0200 Subject: rebel-lang: repl: skip output for all Unit values, not just empty statements --- crates/rebel-lang/examples/repl.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'crates') diff --git a/crates/rebel-lang/examples/repl.rs b/crates/rebel-lang/examples/repl.rs index a07c802..8d76ec8 100644 --- a/crates/rebel-lang/examples/repl.rs +++ b/crates/rebel-lang/examples/repl.rs @@ -4,7 +4,7 @@ use rebel_lang::{ typing::{ArrayLen, Type, TypeFamily}, value::{EvalError, Result, Value}, }; -use rebel_parse::{ast::BodyStmt, recipe, tokenize}; +use rebel_parse::{recipe, tokenize}; use reedline::{DefaultPrompt, DefaultPromptSegment, Reedline, Signal, ValidationResult}; fn intrinsic_array_len(params: &[Value]) -> Result { @@ -85,10 +85,6 @@ fn main() { } }; - if matches!(stmt, BodyStmt::Empty) { - continue; - } - if let Err(err) = stmt.validate() { println!("Validation error: {err:?}"); continue; @@ -112,6 +108,9 @@ fn main() { continue; } }; - println!("{value}: {typ}"); + + if value != Value::Unit { + println!("{value}: {typ}"); + } } } -- cgit v1.2.3