isla icon indicating copy to clipboard operation
isla copied to clipboard

[BUG] ISLaSolver.check() error message reports wrong start symbol

Open andreas-zeller opened this issue 1 year ago • 0 comments

In an error message, ISLaSolver.check() reports "" as start symbol, although a different start symbol was given as constructor.

To Reproduce

In the context

digit_solver = ISLaSolver(EXPR_GRAMMAR, start_symbol='<digit>')
str(digit_solver.solve())  # returns '9'
digit_solver.check('9')  # returns True

the invocation

digit_solver.check('2 + 2')

prints

Error parsing "2 + 2" starting with "<start>"

Expected behavior This should print

Error parsing "2 + 2" starting with "<digit>"

since <digit> was specified as the start symbol.

This may be an instance of a more general issue - maybe giving start_symbol defines <start> as <digit>? Also indicate the exact position and/or element of the parsing error (if possible).

System/Installation Specs:

  • ISLa Version: 1.11.1
  • Python Version: 3.10
  • OS: macOS 13.4

andreas-zeller avatar May 20 '23 13:05 andreas-zeller