chenhsi / Ambroscum

An interpreter/compiler for a programming language we're probably going to create
MIT License
0 stars 0 forks source link

Block navigation #3

Closed chenhsi closed 10 years ago

chenhsi commented 11 years ago

Break/continue not yet implemented for loops, and return not implemented for functions.

The currently planned approach is to have Block's evaluate return an enum representing the status under which the block is returning (e.g. terminated normally, break, continue, return). The main issue for consideration is how return's value should be so returned. My preference is to store the value in a separate field, accessible by a getter method, that Function then calls immediately afterwards; however, I am uncertain as to the clarity and style of such an approach.

Related is the issue of loop labels and breaking/continuing with a label, but this can be implemented separatedly, and has lower priority (medium, to be specific).

chenhsi commented 10 years ago

Only labels still need to be implemented, and those are under discussion as to how the syntax will work, so closing for now.