Fix indentation and translation errors in doWrap,

forLoop, ifStatement, and whileLoop functions.
Also fix syntax error in broken_funcCall test
file.
This commit is contained in:
2023-11-14 21:48:04 +00:00
parent 65c608e088
commit c207c0668d
5 changed files with 13 additions and 9 deletions

View File

@@ -96,7 +96,7 @@ func parseForeverLoop(code UNPARSEcode, index int, codeline []UNPARSEcode) (whil
},
index,
codeline,
2,
3,
)
return whileLoop{
condition: true,
@@ -108,13 +108,14 @@ func parseForeverLoop(code UNPARSEcode, index int, codeline []UNPARSEcode) (whil
}
func runWhileLoop(loop whileLoop, stack stack, stacklevel int) (any, ArErr) {
newstack := append(stack, newscope())
for {
condition, err := runVal(loop.condition, newstack, stacklevel+1)
newbodystack := append(newstack, newscope())
if err.EXISTS {
return nil, err
}
newbodystack := append(newstack, newscope())
if !anyToBool(condition) {
break
}