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

Renaming symbols is incorrect #23

Closed
certik opened this issue Dec 6, 2024 · 4 comments
Closed

Renaming symbols is incorrect #23

certik opened this issue Dec 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@certik
Copy link
Contributor

certik commented Dec 6, 2024

program expr2
implicit none

integer :: program

program = (2+3)*5
print *, program

end program

When you select the program variable, it will rename all occurrences of the term program, not just the variable. We must use LFortran's ASR to find the local variable "program" and only rename that.

@certik certik added the bug Something isn't working label Dec 6, 2024
@dylon
Copy link
Collaborator

dylon commented Dec 9, 2024

We are blocked on fixing this until lfortran/lfortran#5558 is resolved. At the moment, lfortran misses some symbol locations so we perform a global replacement.

@certik
Copy link
Contributor Author

certik commented Dec 19, 2024

This still does not work. It seems to be doing a global replacement.

There are two issues that I can see:

  • silencing an LFortran failure (if that is the case --- not sure)
  • doing global replacement, which I do not want

To fix this, let's add a settings option that will disable any silent failover; I will then enable this and then I want to see a clear error in the logs every time something fails. Then we can report all bugs and fix it.

I made this #33.

@Pranavchiku
Copy link
Member

Pranavchiku commented Dec 19, 2024

Yes, I can reproduce this:

image

on Rename

image

renamed variable

image

@certik
Copy link
Contributor Author

certik commented Dec 26, 2024

It seems to work now:

image

So I am going to close it.

@certik certik closed this as completed Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants