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

Optimiser logic addition. Deletion of unused variables #62

Open
NickSettler opened this issue Nov 21, 2022 · 0 comments
Open

Optimiser logic addition. Deletion of unused variables #62

NickSettler opened this issue Nov 21, 2022 · 0 comments
Assignees
Labels
feature New feature or request optimiser Changes in optimiser code

Comments

@NickSettler
Copy link
Owner

It is needed to add deletion of unused variables to code optimiser. Variable can be deleted in the following cases:

  • It is not used anywhere in the code
  • It is used only in assignment expression, where the left part of assignment is a variable going to be deleted
// First case example
$a = 1;         # this line can be deleted
write("Hello world");

// Second case example
$i = 0;
$b = 0;         # this line can be deleted
while ($i < 10) {
  $b = $b + 1;  # this line can be deleted
  $i = $i + 1;
}
write($i);
@NickSettler NickSettler added feature New feature or request optimiser Changes in optimiser code labels Nov 21, 2022
@NickSettler NickSettler added this to VUT Nov 21, 2022
@NickSettler NickSettler moved this to Todo in VUT Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request optimiser Changes in optimiser code
Projects
Status: Todo
Development

No branches or pull requests

2 participants