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

@@ -42,7 +42,7 @@ func parseDoWrap(code UNPARSEcode, index int, codelines []UNPARSEcode) (any, boo
for i := 0; i < len(codelines); {
indent := len(codelines[i].code) - len(strings.TrimLeft(codelines[i].code, " "))
if indent != setindent {
return nil, false, ArErr{"Syntax Error", "invalid indent", i, code.path, codelines[i].code, true}, 1
return nil, false, ArErr{"Syntax Error", "invalid indent", code.line, code.path, codelines[i].code, true}, 1
}
val, _, err, step := translateVal(codelines[i], i, codelines, 3)
@@ -57,9 +57,9 @@ func parseDoWrap(code UNPARSEcode, index int, codelines []UNPARSEcode) (any, boo
func runDoWrap(d dowrap, Stack stack, stacklevel int) (any, ArErr) {
newstack := append(Stack, newscope())
newstackCopy := make(stack, len(newstack))
copy(newstackCopy, newstack)
for _, v := range d.run {
newstackCopy := make(stack, len(newstack))
copy(newstackCopy, newstack)
val, err := runVal(v, newstackCopy, stacklevel+1)
if err.EXISTS {
return nil, err