yuxshao/makergame

break statements

Closed this issue · 1 comments

now that we have foreach loops break statements would be very helpful to stop iteration in any of the three loop structures. i think it'll be a common use case too e.g. if we have thousands of objects and want to just select any one.

maybe more generally a break can jump to the end of the current block, provided it's not an event or function block. in addition to the semant checks this'll involve passing around an extra bit of information in the stmt function to indicate where a break should jump to.

edit: jumping to the end of the current block is sort of useless if it's not a loop so scratch that 'generalization'