From 4de84a37bbcd500ced80a2e614ecc16315604e2b Mon Sep 17 00:00:00 2001 From: Florian Pommerening Date: Tue, 10 Dec 2024 14:11:22 +0100 Subject: [PATCH] small fixes --- src/search/tasks/root_task.cc | 3 ++- src/search/utils/task_parser.cc | 4 ++-- src/search/utils/task_parser.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/search/tasks/root_task.cc b/src/search/tasks/root_task.cc index e2b7be489a..c8807701e2 100644 --- a/src/search/tasks/root_task.cc +++ b/src/search/tasks/root_task.cc @@ -179,7 +179,8 @@ void ExplicitOperator::read_pre_post( utils::TaskParser &task_parser, bool is_axiom) { bool read_from_single_line = !is_axiom; vector conditions = read_facts(task_parser, read_from_single_line); - int var = task_parser.read_int("variable affected by " + is_axiom ? "axiom" : "effect"); + string source = is_axiom ? "axiom" : "effect"; + int var = task_parser.read_int("variable affected by " + source); int value_pre = task_parser.read_int("variable value precondition"); int value_post = task_parser.read_int("variable value postcondition"); task_parser.confirm_end_of_line(); diff --git a/src/search/utils/task_parser.cc b/src/search/utils/task_parser.cc index 6a1067ff12..790636cadb 100644 --- a/src/search/utils/task_parser.cc +++ b/src/search/utils/task_parser.cc @@ -18,7 +18,7 @@ TaskParser::TaskParser(istream &stream) } void TaskParser::find_next_line(bool throw_error_on_failure) { - assert(may_start_line); // We probably forgot a confirm_end_of_line. + assert(may_start_line()); // We probably forgot a confirm_end_of_line. string next_line; while (!stream.eof()) { getline(stream, next_line); @@ -85,7 +85,7 @@ int TaskParser::read_int(const string &message) { return parse_int(token, message); } -string TaskParser::read_line(const string &message) { +string TaskParser::read_line(const string &/*message*/) { find_next_line(true); return line; } diff --git a/src/search/utils/task_parser.h b/src/search/utils/task_parser.h index 34b1cb55ec..e2f9c6f66e 100644 --- a/src/search/utils/task_parser.h +++ b/src/search/utils/task_parser.h @@ -75,7 +75,7 @@ class TaskParser { */ void confirm_end_of_input(); // TODO: Should this be public at all? Or should we add a get_line method? - void error(const std::string &message) const; + NO_RETURN void error(const std::string &message) const; }; } #endif