Today’s exercise was the Sieve of Eratosthenes. You find prime numbers by filtering out numbers that are a multiple other primes (>= 2).

I worked on refactoring the IF statement today. I broke it up into if, elseif, else, and endif components. I had to add GOTO to be able to jump to an end-if. Right now if isn’t working right in single line mode especially if you have a statement list after the then. I don’t think it is working at all if the first clause is false.

I need to simplify my jump targets so you know where to go when the expression you check is false. I am thinking of something like if () then which jumps to if_1_next_1 if false. On subsequent else/else-if clauses jump to if_1_next_n where n is one more than the last one. Before parsing a else/else-if add in a jump to if_1_endif so that if the expression check is true you jump to the end without bumping into else/elseif clauses. Then finally on end if I need the final if_1_next_n target and the if_1_endif target.

For goto if the label/line number doesn’t exist it jumps to the end of the program. It is for single line repl mode mostly. Trying to skip any remaining statement list.