Skip to content

Commit

Permalink
[issue1029] better error message for missing "(define "
Browse files Browse the repository at this point in the history
In the translation algorithm, the assertion now contains some details
about what went wrong in when a domain or a problem does not start
with "(define ".
  • Loading branch information
Victor Paleologue committed Sep 1, 2021
1 parent de3c086 commit 15f72db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ after the corresponding tracker issues.

## Changes since the last release

- Better error message when domain does not start with `(define`.
<http://issues.fast-downward.org/issue1029>

- Add debugging methods to LP solver interface.
<http://issues.fast-downward.org/issue960>
You can now assign names to LP variables and constraints for easier
Expand Down
5 changes: 4 additions & 1 deletion src/translate/pddl_parser/parsing_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ def parse_domain_pddl(domain_pddl):
iterator = iter(domain_pddl)

define_tag = next(iterator)
assert define_tag == "define"
assert define_tag == "define", (
"domain specification must begin with \"(define \", "
"found \"(%s \" instead." % define_tag
)
domain_line = next(iterator)
assert domain_line[0] == "domain" and len(domain_line) == 2
yield domain_line[1]
Expand Down

0 comments on commit 15f72db

Please sign in to comment.