From 848749cf250bafd0e14ae9e7ca41bfdee11a35b6 Mon Sep 17 00:00:00 2001 From: florijan Date: Thu, 8 Mar 2018 10:36:17 +0100 Subject: [PATCH] Fix and rename REPL Summary: Fix and rename REPL Reviewers: teon.banek Reviewed By: teon.banek Differential Revision: https://phabricator.memgraph.io/D1284 --- src/CMakeLists.txt | 2 +- src/query/{console.cpp => repl.cpp} | 6 +++--- src/query/{console.hpp => repl.hpp} | 0 tests/manual/distributed_repl.cpp | 2 +- tests/manual/query_planner.cpp | 2 +- tests/manual/{console_test.cpp => repl.cpp} | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename src/query/{console.cpp => repl.cpp} (97%) rename src/query/{console.hpp => repl.hpp} (100%) rename tests/manual/{console_test.cpp => repl.cpp} (98%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b20672bf6..41cbb0aa8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,7 +26,7 @@ set(memgraph_src_files io/network/endpoint.cpp io/network/socket.cpp query/common.cpp - query/console.cpp + query/repl.cpp query/frontend/ast/ast.cpp query/frontend/ast/cypher_main_visitor.cpp query/frontend/semantic/symbol_generator.cpp diff --git a/src/query/console.cpp b/src/query/repl.cpp similarity index 97% rename from src/query/console.cpp rename to src/query/repl.cpp index dec2a8fe9..ec966fb74 100644 --- a/src/query/console.cpp +++ b/src/query/repl.cpp @@ -1,4 +1,4 @@ -#include "console.hpp" +#include "repl.hpp" #include #include @@ -49,6 +49,8 @@ std::string ReadLine(const char *prompt) { #endif // HAS_READLINE void query::Repl(database::GraphDb &db) { + query::Interpreter interpeter; + std::cout << "Welcome to *Awesome* Memgraph Read Evaluate Print Loop (AM-REPL)" << std::endl; @@ -59,8 +61,6 @@ void query::Repl(database::GraphDb &db) { // special commands if (command == "quit") break; - query::Interpreter interpeter; - // regular cypher queries try { database::GraphDbAccessor dba(db); diff --git a/src/query/console.hpp b/src/query/repl.hpp similarity index 100% rename from src/query/console.hpp rename to src/query/repl.hpp diff --git a/tests/manual/distributed_repl.cpp b/tests/manual/distributed_repl.cpp index e32386156..edd6fd0ab 100644 --- a/tests/manual/distributed_repl.cpp +++ b/tests/manual/distributed_repl.cpp @@ -7,7 +7,7 @@ #include #include "database/graph_db.hpp" -#include "query/console.hpp" +#include "query/repl.hpp" #include "query/interpreter.hpp" #include "utils/flag_validation.hpp" diff --git a/tests/manual/query_planner.cpp b/tests/manual/query_planner.cpp index 8c66e9211..a1851e8d5 100644 --- a/tests/manual/query_planner.cpp +++ b/tests/manual/query_planner.cpp @@ -34,7 +34,7 @@ DEFINE_string(load_mock_db_file, "", DECLARE_int32(min_log_level); #ifdef HAS_READLINE -// TODO: This is copied from src/query/console.cpp +// TODO: This is copied from src/query/repl.cpp // It should probably be moved to some utils file. #include "readline/history.h" diff --git a/tests/manual/console_test.cpp b/tests/manual/repl.cpp similarity index 98% rename from tests/manual/console_test.cpp rename to tests/manual/repl.cpp index 9cab8db91..445aaa25f 100644 --- a/tests/manual/console_test.cpp +++ b/tests/manual/repl.cpp @@ -6,7 +6,7 @@ #include #include "database/graph_db.hpp" -#include "query/console.hpp" +#include "query/repl.hpp" #include "query/interpreter.hpp" #include "utils/random_graph_generator.hpp"