panda-planner-dev / pandaPIparser

The parser of the pandaPI planning system
BSD 3-Clause "New" or "Revised" License
13 stars 10 forks source link

Line numbers seem to accumulate across files #14

Closed rpgoldman closed 1 year ago

rpgoldman commented 1 year ago

Here's an invocation of pandaPIparser that encountered a parse error in its problem file:

pandaPIparser domain.hddl p01.hddl
pandaPIparser is configured as follows
  Colors in output: true
  Mode: parsing mode
  Parameter splitting: true
  Conditional effects: exponential encoding
  Disjunctive preconditions as HTN: false
  Replace goal with action: false
  Output: pandaPI format
!Parse error in file p01.hddl in line 235
unexpected KEY_ORDER_TASKS

The entire file p01.hddl is only 27 lines long. However domain.hddl is 208 lines long. So I conjecture that the line counter is not reset when pandaPIparser closes domain.hddl and opens p01.hddl.

galvusdamor commented 1 year ago

Yup. I've fixes this issue with commit 1613b83. Your conjecture was fully correct - I did not reset the line number counter of flex. Now we are fully de-initialising flex after the first file has been parsed. This should also remove any potential other problem related to not resetting it correctly.