Change FOREACH to FOR (#680)

This commit is contained in:
Rangi
2021-01-01 18:46:26 -05:00
committed by GitHub
parent 10e3f1a02b
commit 7bb6f71f0b
9 changed files with 63 additions and 63 deletions

View File

@@ -1,44 +1,44 @@
foreach n, 10
for n, 10
printt "{d:n} "
endr
printt "-> {d:n}\n"
foreach v, 0
for v, 0
printt "unreached"
endr
foreach v, 2, 1
for v, 2, 1
printt "unreached"
endr
foreach v, 1, 2, 0
for v, 1, 2, 0
printt "unreached"
endr
foreach x, 1, 5+1
for x, 1, 5+1
printt "{d:x} "
endr
printt "-> {d:x}\n"
foreach v, 10, -1, -1
for v, 10, -1, -1
printt "{d:v} "
v = 42
endr
printt "-> {d:v}\n"
foreach q, 5, 21, 5
for q, 5, 21, 5
printt "{d:q} "
purge q
endr
printt "-> {d:q}\n"
s EQUS "x"
foreach s, 3, 30, 3
for s, 3, 30, 3
printt "{d:x} "
endr
printt "-> {d:x}\n"
foreach v, 10
for v, 10
printt "{d:v}\n"
if v == 3
purge v

6
test/asm/for.err Normal file
View File

@@ -0,0 +1,6 @@
ERROR: for.asm(16):
FOR cannot have a step value of 0
ERROR: for.asm(41) -> for.asm::REPT~5(47):
'v' already defined as constant at for.asm(41) -> for.asm::REPT~4(45)
FATAL: for.asm(41) -> for.asm::REPT~5(47):
Failed to update FOR symbol value

View File

@@ -1,6 +0,0 @@
ERROR: foreach.asm(16):
FOREACH cannot have a step value of 0
ERROR: foreach.asm(41) -> foreach.asm::REPT~5(47):
'v' already defined as constant at foreach.asm(41) -> foreach.asm::REPT~4(45)
FATAL: foreach.asm(41) -> foreach.asm::REPT~5(47):
Failed to update FOREACH symbol value