Ignore blank inputs.

Previously, nix-repl would consider this an incomplete parse and wait for the
next line as if it was a multiline input.

Blank lines in the middle of a multiline input will continue to work.
This commit is contained in:
Scott Olson 2016-02-23 18:30:21 -06:00
parent 87e6649fc3
commit 38816759fc

View file

@ -106,7 +106,7 @@ void NixRepl::mainLoop(const Strings & files)
}
try {
if (!processLine(input)) return;
if (!removeWhitespace(input).empty() && !processLine(input)) return;
} catch (ParseError & e) {
if (e.msg().find("unexpected $end") != std::string::npos) {
// For parse errors on incomplete input, we continue waiting for the next line of