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

Statement starting location is off #2483

Open
RustanLeino opened this issue Jul 22, 2022 · 1 comment
Open

Statement starting location is off #2483

RustanLeino opened this issue Jul 22, 2022 · 1 comment
Labels
difficulty: good-first-issue Good first issues part: parser First phase of Dafny's pipeline

Comments

@RustanLeino
Copy link
Collaborator

In the VS Code IDE, I see

image

The Repr field is ghost, so note that most of the assignment statement is visually indicated as being ghost. However, the cv. part of the statement is not. I suspect this is because the statement .Tok doesn't give the start location of the statement.

I'm reporting this issue here, as opposed to in dafny-lang/ide-vscode, because I suspect the IDE just uses the .Tok field of the assignment statement.

Possible fix

I think the fix is to change the UpdateStmt<out Statement/*!*/ s> production in Dafny.atg to make it start off with var start = la; and then use this start instead of x in the various s = new ... at the end of the production. After that, the x is probably no longer needed.

I don't think this .Tok for various kinds of update statements is used for anything else, so I don't think this change will affect anything other than the ghost highlighting in the IDE.

@RustanLeino RustanLeino added part: parser First phase of Dafny's pipeline difficulty: good-first-issue Good first issues labels Jul 22, 2022
@davidcok davidcok self-assigned this Apr 22, 2023
@davidcok davidcok removed their assignment Apr 29, 2023
@davidcok
Copy link
Collaborator

My experimentation indicates that the parser produces the correct token (at least as of now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: good-first-issue Good first issues part: parser First phase of Dafny's pipeline
Projects
None yet
Development

No branches or pull requests

2 participants