corth-lang / Corth

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

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

Open HuseyinSimsek7904 opened 11 months ago

HuseyinSimsek7904 commented 11 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.