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

The Quick Interpreter gives a "null" in the message #656

Closed
peterwvj opened this issue Dec 4, 2017 · 2 comments
Closed

The Quick Interpreter gives a "null" in the message #656

peterwvj opened this issue Dec 4, 2017 · 2 comments
Labels
bug Incorrect behaviour of the tool Mergable A fix is available on a branch to merge for release
Milestone

Comments

@peterwvj
Copy link
Member

peterwvj commented Dec 4, 2017

Description

The Quick Interpreter gives a "null" in the message if you evaluate something like "1 +" (without the quotes)

Steps to Reproduce

  1. Evaluate "1+" (without the quotes) in the quick interpreter

Expected behavior:

A meaningful (parse) error should be printed.

Actual behavior:

The quick interpreter reports.

Error 2034: Unexpected token in expression: null in 'DEFAULT' (console) at line 2:0

The message should be something more meaningful than "null".

Reproduces how often:

Every time.

Versions

  • Overture 2.5.2
  • Ubuntu 17.04 (64 bit)
  • OpenJDK 1.8.0_0151 (64 bit)
@peterwvj peterwvj added the bug Incorrect behaviour of the tool label Dec 4, 2017
@peterwvj peterwvj added this to the v2.5.6 milestone Dec 4, 2017
@nickbattle
Copy link
Contributor

This was because the VDMToken for EOF had a "null" display string - thinking that it would never be used. But when you parse "1 +", then token location of the error is EOF. So I've made the display string for EOF be "EOF". I haven't built a full tool, but this fixes the problem on the command line (which was showing the same behaviour).

Now pushed to ncb/development.

@nickbattle nickbattle added the Mergable A fix is available on a branch to merge for release label Dec 4, 2017
@nickbattle
Copy link
Contributor

OK, I built a version with this included, and it's fine:

1+ = Error 2034: Unexpected token in expression: EOF in 'DEFAULT' (console) at line 2:0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behaviour of the tool Mergable A fix is available on a branch to merge for release
Projects
None yet
Development

No branches or pull requests

2 participants