anoniscoding / yorlang

A programming language with yoruba language construct
https://anoniscoding.github.io/yorlang/
MIT License
450 stars 70 forks source link

Counter Loop variables passed to Functions do not change. #47

Closed mykeels closed 5 years ago

mykeels commented 5 years ago

Describe the bug When a loop's counter variable is passed to a function, the first value passed becomes the value for all subsequent passes.

To Reproduce Run the following code:

ise output (i) {
    sọpé i;
}

fún (jeki i = 1; i <= 3; jeki i = i + 1;) {
    output(i);
}

prints out

1
1
1

Expected behavior The actual values get passed to the function, so it prints out

1
2
3
anoniscoding commented 5 years ago

Thanks bro, found the bug. Will be making a PR to close the issue. More catches in the future