Skip to content

Commit 0a43a81

Browse files
authored
Merge pull request #391 from detrumi/repl-allow-blank-line
Avoid parse error when entering empty line in repl
2 parents 2c72044 + 5a7f186 commit 0a43a81

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)