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

[Frontend] Parsing and analyzing the same file with a syntactic error can return different messages #179

Open
rturrado opened this issue Dec 14, 2023 · 2 comments

Comments

@rturrado
Copy link
Contributor

For instance, mistyping version as vrsion returns:

  • for parsing: :1:1: mismatched input 'vrsion' expecting {NEW_LINE, ';', 'version'}, and
  • for analyzing: Error: :1:1: syntax error.
@rturrado
Copy link
Contributor Author

This is what I think it is happening here:

  • libqasm analyzes v1 and v3 programs. And, in order to do that, it has a version parser, i.e., a parser that is dedicated to parsing the version only. So we first parse the version and then call the v1 or the v3 parser.
  • Now, looking at the errors, it seems that the parser error comes from ANTLR, while the analyzer error comes from the version parser. I.e., the parsing API is not using the version parser, but the analyzing API is using it.
  • I should have a look and see if this is an expected behaviour or not.

@rturrado
Copy link
Contributor Author

rturrado commented Mar 8, 2024

If, in a near future, we drop v1, we may not have this issue anymore.

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

No branches or pull requests

1 participant