core: for/foreach -> Loop normalization (always-on); LoopForm MVP-3 per-segment reorder; smokes stabilized (VM + LLVM PHI); docs updated (macro-system, loopform); quiet macro load logs

This commit is contained in:
Selfhosting Dev
2025-09-20 08:39:40 +09:00
parent f50f79994f
commit 8a84339ac2
20 changed files with 1216 additions and 32 deletions

View File

@ -0,0 +1,3 @@
for(fn(){ local i = 0 }, i < 3, fn(){ i = i + 1 }, fn(){
print(i)
})

View File

@ -0,0 +1,4 @@
local arr = [1,2,3]
foreach(arr, "x", fn() {
print(x)
})

View File

@ -0,0 +1,9 @@
local i = 0
loop(i < 6) {
print(i)
if (i == 3) {
break
}
i = i + 1
}

View File

@ -0,0 +1,11 @@
local i = 0
local sum = 0
loop(i < 5) {
i = i + 1
if (i % 2 == 0) {
continue
}
sum = sum + i
print(sum)
}