mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 17:06:07 +00:00
add paster to some weird golang incorrect memory address bug
This commit is contained in:
@@ -20,11 +20,11 @@ func isDoWrap(code UNPARSEcode) bool {
|
||||
func parseDoWrap(code UNPARSEcode, index int, codelines []UNPARSEcode) (any, bool, ArErr, int) {
|
||||
currentindent := len(code.realcode) - len(strings.TrimLeft(code.realcode, " "))
|
||||
var setindent int = -1
|
||||
var i = index + 1
|
||||
translated := []any{}
|
||||
for i < len(codelines) {
|
||||
var allCodelines = []UNPARSEcode{}
|
||||
i := index + 1
|
||||
for ; i < len(codelines); i++ {
|
||||
|
||||
if isBlank(codelines[i]) {
|
||||
i++
|
||||
continue
|
||||
}
|
||||
indent := len(codelines[i].code) - len(strings.TrimLeft(codelines[i].code, " "))
|
||||
@@ -34,6 +34,13 @@ func parseDoWrap(code UNPARSEcode, index int, codelines []UNPARSEcode) (any, boo
|
||||
if indent <= currentindent {
|
||||
break
|
||||
}
|
||||
allCodelines = append(allCodelines, codelines[i])
|
||||
}
|
||||
finalLines := i
|
||||
codelines = allCodelines
|
||||
translated := []any{}
|
||||
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
|
||||
}
|
||||
@@ -45,13 +52,15 @@ func parseDoWrap(code UNPARSEcode, index int, codelines []UNPARSEcode) (any, boo
|
||||
}
|
||||
translated = append(translated, val)
|
||||
}
|
||||
return dowrap{run: translated, line: code.line, path: code.path, code: code.realcode}, true, ArErr{}, i - index
|
||||
return dowrap{run: translated, line: code.line, path: code.path, code: code.realcode}, true, ArErr{}, finalLines - index
|
||||
}
|
||||
|
||||
func runDoWrap(d dowrap, stack stack, stacklevel int) (any, ArErr) {
|
||||
newstack := append(stack, newscope())
|
||||
func runDoWrap(d dowrap, Stack stack, stacklevel int) (any, ArErr) {
|
||||
newstack := append(Stack, newscope())
|
||||
for _, v := range d.run {
|
||||
val, err := runVal(v, newstack, stacklevel+1)
|
||||
newstackCopy := make(stack, len(newstack))
|
||||
copy(newstackCopy, newstack)
|
||||
val, err := runVal(v, newstackCopy, stacklevel+1)
|
||||
if err.EXISTS {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user