From 6ce94264f3449fd5c18a9437c82515e4144b07ff Mon Sep 17 00:00:00 2001 From: Victor Paleologue Date: Thu, 11 Jun 2020 15:07:56 +0200 Subject: [PATCH] [issue1030] more explicit error when parsing an empty goal --- CHANGES.md | 3 ++- src/translate/pddl_parser/parsing_functions.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 93910baf3e..328f491cdc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,7 +11,8 @@ after the corresponding tracker issues. ## Changes since the last release -- none yet +- Better error message for empty goal. + ## Fast Downward 22.06 diff --git a/src/translate/pddl_parser/parsing_functions.py b/src/translate/pddl_parser/parsing_functions.py index fdc0b9dc80..70ffc0d40f 100644 --- a/src/translate/pddl_parser/parsing_functions.py +++ b/src/translate/pddl_parser/parsing_functions.py @@ -460,7 +460,9 @@ def parse_task_pddl(task_pddl, type_dict, predicate_dict): yield initial goal = next(iterator) - assert goal[0] == ":goal" and len(goal) == 2 + assert goal[0] == ":goal" and len(goal) == 2 and goal[1], ( + "missing or empty goal" + ) yield parse_condition(goal[1], type_dict, predicate_dict) use_metric = False