summaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-28 16:33:31 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-28 16:44:16 +0200
commit50c68f0cdf36983e61691e4a229a6d01fd0b5f78 (patch)
tree59fd6d9d80b7fe9dd74a94dfa37f83dc20b7d61e /crates
parent476e0b02e7570d5f04f7b4fa8614b3cb46de919b (diff)
downloadrebel-50c68f0cdf36983e61691e4a229a6d01fd0b5f78.tar
rebel-50c68f0cdf36983e61691e4a229a6d01fd0b5f78.zip
rebel-lang: repl: skip output for all Unit values, not just empty statements
Diffstat (limited to 'crates')
-rw-r--r--crates/rebel-lang/examples/repl.rs11
1 files changed, 5 insertions, 6 deletions
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<Value> {
@@ -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}");
+ }
}
}