corth-lang / Corth

A self-hosted stack based language like Forth
MIT License
7 stars 1 forks source link

`else` keyword after `while-do` statement #23

Open HuseyinSimsek7904 opened 9 months ago

HuseyinSimsek7904 commented 9 months ago

Just like in Python, Corth should allow while <cond> do <code> else <code> end statements where the code after the else keyword is run only if the while-do loop is not broken with break. This will be very easy to implement as compiler creates a label for that purpose already.