anoniscoding / yorlang

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

feat: ensure jeki and terminator are not compulsory in fun's increment #56

Closed mykeels closed 5 years ago

mykeels commented 5 years ago

Currently, the syntax for fun is:

fún (jeki i = 1; i <= 5; jeki i = i + 1;) {
    sọpé yipo(7);
}

The jeki beginning the increment section of fun i.e. jeki i = i + 1; and its ending semi-colon are somewhat redundant.

This PR helps fix that, by ensuring they are optional, and adding backward compatibility, so it can now be written as:

fún (jeki i = 1; i <= 5; i = i + 1) {
    sọpé yipo(7);
}