- Lexer: recognize 'if' as keyword (TOK_IF) - Parser: add NODE_IF with if_statement union, parse if/cond/body, handle unary minus in parse_term as 0 - expr - Eval: add NODE_IF evaluation, move GC to NODE_BLOCK level to avoid destroying temporary values during sub-expression evaluation
4 lines
40 B
Plaintext
4 lines
40 B
Plaintext
x = 20
|
|
if x < 10:
|
|
print x
|
|
print -300 |