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

[Hungarian Notation] Variables with different names but same labels are renamed to the same variable. #317

Conversation

github-actions[bot]
Copy link
Contributor

closes #309

@github-actions github-actions bot added bug Something isn't working priority-high High priority issue labels Aug 15, 2023
@NeoQuix
Copy link
Collaborator

NeoQuix commented Aug 15, 2023

To decide:

  1. Same name for every variable or custom ones:
  • e.G. var, tmp and every other identifier get the same name ==> Var
  • or custom ones: var => Var, tmp => Tmp, ...
    If for custom names:
  • is every custom name seperated by a _ or how can i reliably extract the name?
  1. Same counter for every variable or one counter for every "type":
  • e.G. var_0 => Var0, tmp_0 => Var1 ...
  • or var_0 => Var0, tmp_0 => Tmp0
  1. Prefix for invalid stuff
  • invalid stuff will sometimes get nothing as a prefix. Maybe change it, to a "default" value like unk?

@NeoQuix
Copy link
Collaborator

NeoQuix commented Aug 15, 2023

Also: Substitute variables in a batch (dictionary) instead of iterating over AST every time

@NeoQuix
Copy link
Collaborator

NeoQuix commented Aug 23, 2023

Will only go once through the whole tree, but will still call n times replace_variable for all n replacement pairs in the nodes.
==> a bit faster, but not really

If the nodes would know the variables in their instructions, it could be faster.

@NeoQuix NeoQuix marked this pull request as ready for review August 23, 2023 09:12
@steffenenders steffenenders requested a review from ebehner August 24, 2023 08:52
@NeoQuix NeoQuix force-pushed the issue-309-_Hungarian_Notation_Variables_with_different_names_but_same_labels_are_renamed_to_the_same_variable branch 3 times, most recently from 0be5830 to 20facab Compare June 11, 2024 11:12
@NeoQuix
Copy link
Collaborator

NeoQuix commented Jun 11, 2024

Rebase onto main.
Further changes/comments only done in #416

@NeoQuix
Copy link
Collaborator

NeoQuix commented Jun 19, 2024

Removing old review because of too much changes.

@NeoQuix NeoQuix dismissed ebehner’s stale review June 19, 2024 08:11

Completly new code.

@NeoQuix NeoQuix force-pushed the issue-309-_Hungarian_Notation_Variables_with_different_names_but_same_labels_are_renamed_to_the_same_variable branch from a8d6d85 to c068b60 Compare August 14, 2024 12:31
…_different_names_but_same_labels_are_renamed_to_the_same_variable
@ebehner ebehner merged commit 0e451e9 into main Aug 19, 2024
1 check passed
@ebehner ebehner deleted the issue-309-_Hungarian_Notation_Variables_with_different_names_but_same_labels_are_renamed_to_the_same_variable branch August 19, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high High priority issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Hungarian Notation] Variables with different names but same labels are renamed to the same variable.
2 participants