From 8e2d79577824f972ae13cf7ffb1c922e768a3340 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Fri, 22 Jun 2018 14:34:16 -0700 Subject: [PATCH] [cli] Handle line comments in EDN input. (#759) (#761) r=grisha What was happening is that ["[;", "]"] would get glued to "[; ]", which of course can never complete. It would be good to add tests of this, but the existing multi-line `InputReader` makes that challenging and I don't want to invest the time to improve it: I expect it to be overhauled as part of a transition away from parsing with `combine` and toward parsing with `rust-peg`. --- tools/cli/src/mentat_cli/input.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cli/src/mentat_cli/input.rs b/tools/cli/src/mentat_cli/input.rs index 9c9f3945..5956ef91 100644 --- a/tools/cli/src/mentat_cli/input.rs +++ b/tools/cli/src/mentat_cli/input.rs @@ -133,13 +133,13 @@ impl InputReader { // If there is no in process command, we parse the read in line as a new command. let cmd = match &self.in_process_cmd { &Some(Command::QueryPrepared(ref args)) => { - Ok(Command::QueryPrepared(args.clone() + " " + &line)) + Ok(Command::QueryPrepared(args.clone() + "\n" + &line)) }, &Some(Command::Query(ref args)) => { - Ok(Command::Query(args.clone() + " " + &line)) + Ok(Command::Query(args.clone() + "\n" + &line)) }, &Some(Command::Transact(ref args)) => { - Ok(Command::Transact(args.clone() + " " + &line)) + Ok(Command::Transact(args.clone() + "\n" + &line)) }, _ => { command(&self.buffer)