Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor error message for simple syntax error #3441

Open
FliegendeWurst opened this issue Mar 8, 2024 · 0 comments
Open

Poor error message for simple syntax error #3441

FliegendeWurst opened this issue Mar 8, 2024 · 0 comments

Comments

@FliegendeWurst
Copy link
Member

Description

Try to load the file below. It contains a syntax error (== instead of = in the problem statement), but the error message produced by KeY is bad:

line 1:1 mismatched input '5' expecting {<EOF>, '\sorts', '\schemaVariables', '\programVariables', '\include', '\includeLDTs', '\classpath', '\bootclasspath', '\javaSource', '\withOptions', '\optionsDecl', '\settings', '\profile', '\heuristicsDecl', '\predicates', '\functions', '\datatypes', '\transformers', '\rules', '\axioms', '\problem', '\chooseContract', '\proofObligation', '\proof', '\contracts', '\invariants', '/*!'}

The issue occurs because the stream is not reset to the start of the file after trying the parsing process again in non-SLL mode.

testing.key:

\functions {
    int b;
}

\problem {
    (\exists int c; c == 5 && c < b)
    & (\exists int c; c = 7 && c > b)
    -> 
    b == 6
}

Reproducible

always

Steps to reproduce

  1. Load testing.key
  2. Observe the error message

Expected behaviour: reasonable error message
Actual behaviour: stupid error message (see above)

Additional information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant