From 0ee5e27843bb7460e1554a39a7a4904fba3a1177 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 25 Nov 2021 10:07:50 +0200 Subject: Show message when symbol table is empty and #symbols is invoked in REPL --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 5546094..85c7435 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,6 +85,9 @@ fn main() -> Result<(), String> { if s.starts_with("#exit") { return Ok(()); } else if s.starts_with("#symbols") { + if symbol_table.is_empty() { + println!("[repl] symbol table is empty"); + } for (symbol, expr) in &symbol_table { println!("{}:\n{}\n", symbol, *expr); } -- cgit v1.3