Skip to content

Commit 5a7f186

Browse files
committed
Avoid parse error when entering empty line in repl
1 parent 2c72044 commit 5a7f186

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ fn process(
197197
rl: &mut rustyline::Editor<()>,
198198
prog: &mut Option<LoadedProgram>,
199199
) -> Result<()> {
200-
if command == "help" || command == "h" {
200+
if command.is_empty() {
201+
// Ignore empty commands.
202+
} else if command == "help" || command == "h" {
201203
// Print out interpreter commands.
202204
// TODO: Implement "help <command>" for more specific help.
203205
help()

0 commit comments

Comments
 (0)