diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2021-11-25 10:07:50 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2021-11-25 19:01:31 +0200 |
| commit | 0ee5e27843bb7460e1554a39a7a4904fba3a1177 (patch) | |
| tree | 1de48311ca703fe299d6bda7681168cbcbbf9c3c /src/main.rs | |
| parent | 4abdbaabd69a5aac827cb4e2f98c27e5661885cf (diff) | |
Show message when symbol table is empty and #symbols is invoked in REPL
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |
