Complete VM parity with eval and fix operator precedence
VM: add string concatenation in OP_ADD, len() built-in, multi-arg print/println, undefined variable detection, and GC via OP_NOP. Parser: fix operator precedence by splitting into parse_expr (+,-) and parse_term (*,/) so 8 + 2 * 4 = 16 instead of 40. Compiler: emit OP_NOP at start of NODE_BLOCK to trigger GC.
This commit is contained in:
@@ -1,6 +1,2 @@
|
||||
x = 0
|
||||
while x < 10:
|
||||
x = x + 1
|
||||
|
||||
if x > 1000000:
|
||||
println("OK")
|
||||
x = 8 + 2 * 4
|
||||
print(x, end="\n")
|
||||
@@ -1,4 +1,5 @@
|
||||
x = 0
|
||||
while x < 1000000000:
|
||||
while x < 10000000:
|
||||
x = x + 1
|
||||
println(x)
|
||||
print(x)
|
||||
debugHeap()
|
||||
Reference in New Issue
Block a user