finish operators

This commit is contained in:
2023-03-08 23:41:33 +00:00
parent 09deba8912
commit 0892b78fd4
6 changed files with 177 additions and 28 deletions

View File

@@ -14,16 +14,18 @@ func isBlank(code UNPARSEcode) bool {
return strings.TrimSpace(code.code) == ""
}
func parseComment(code UNPARSEcode, index int, codelines []UNPARSEcode) (any, bool, ArErr) {
func parseComment(code UNPARSEcode, index int, codelines []UNPARSEcode) (any, bool, ArErr, int) {
split := strings.Split(code.code, "#")
temp := []string{}
step := 1
for i := 0; i < len(split)-1; i++ {
temp = append(temp, split[i])
joined := strings.Join(temp, "#")
resp, worked, _, _ := translateVal(UNPARSEcode{code: joined, realcode: code.realcode, line: code.line, path: code.path}, index, codelines, true)
resp, worked, _, s := translateVal(UNPARSEcode{code: joined, realcode: code.realcode, line: code.line, path: code.path}, index, codelines, true)
step += s - 1
if worked {
return resp, true, ArErr{}
return resp, true, ArErr{}, step
}
}
return nil, false, ArErr{"Syntax Error", "invalid comment", code.line, code.path, code.realcode, true}
return nil, false, ArErr{"Syntax Error", "invalid comment", code.line, code.path, code.realcode, true}, step
}