Added ELSE and WHILE — the language is getting dangerous 💀🤣
ELSE was actually pretty simple: after an IF, just peek at the next line,
see if it says “ELSE”, skip the keyword and execute whatever comes after.
Done. Took longer to think about than to code.
WHILE was a different story. The trick: WHILE is basically just IF + GOTO
combined. If the condition is true, keep going. If false, hunt forward
through the program array for the matching ENDWHILE (counting nested WHILEs
so you don’t bail out too early). ENDWHILE does the reverse — searches
backwards for its WHILE and jumps back. No stack, no AST, just vibes and
array indexing.
Next up: syntax highlighting. The editor deserves to look as good as the
language runs.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.