From 11b92f73462f7006f1991305f529836c08b5ecf8 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 5 Mar 2021 14:41:46 +0100 Subject: [PATCH] Make the argument of parseString a const reference. --- src/headers/misc.hpp | 2 +- src/parser/MainParse.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/misc.hpp b/src/headers/misc.hpp index 4c145af..569692f 100644 --- a/src/headers/misc.hpp +++ b/src/headers/misc.hpp @@ -16,7 +16,7 @@ string getFileContent(const string& file); void setOutputFileContent(const string& language, const string& file, const string& content); #include "ParseComponents.hpp" -ParseTree parseString(unique_ptr toParse); +ParseTree parseString(const unique_ptr& toParse); string transpile(ParseTree toTranspile, string language); #endif //YERBACON_MISC_HPP diff --git a/src/parser/MainParse.cpp b/src/parser/MainParse.cpp index cc10d0a..f4cfca0 100644 --- a/src/parser/MainParse.cpp +++ b/src/parser/MainParse.cpp @@ -6,7 +6,7 @@ using namespace std; -ParseTree parseString(unique_ptr toParse) { +ParseTree parseString(const unique_ptr& toParse) { ParseTree parseTree = ParseTree(); auto lexed = lex(*toParse); for (tok& token: lexed) {