vorotynsky/Kroha

Continue statement for loop

vorotynsky opened this issue · 0 comments

Add a continue statement that allows jumping to the beginning of the loop. It's the opposite of the break operator.

Examples

loop L {
  !inc cx
  continue (L)
}
;=======
L_begin:
  inc cx
  jmp L_begin
jmp L_begin
L_end:

And more complicated:

loop L {
  if (x > 0, CL)
    continue(L)
  !inc cx
}
;=======
L_begin:
  cmp cx, 0
  jg CL_begin
  jmp CL_end
  CL_begin:
    jmp L_begin
  CL_end:
  inc cx
jmp L_begin
L_end: