Skip to content

Commit

Permalink
[issue1030] more explicit error when parsing an empty goal
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Paleologue authored and victorpaleologue committed Jun 30, 2022
1 parent 69fe480 commit 6ce9426
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ after the corresponding tracker issues.

## Changes since the last release

- none yet
- Better error message for empty goal.
<http://issues.fast-downward.org/issue1030>

## Fast Downward 22.06

Expand Down
4 changes: 3 additions & 1 deletion src/translate/pddl_parser/parsing_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6ce9426

Please sign in to comment.