mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
fix stack over flow printing bug
This commit is contained in:
@@ -7,8 +7,7 @@ import (
|
|||||||
|
|
||||||
// returns (number|string|nil), error
|
// returns (number|string|nil), error
|
||||||
func runVal(line any, stack stack, stacklevel int) (any, ArErr) {
|
func runVal(line any, stack stack, stacklevel int) (any, ArErr) {
|
||||||
fmt.Println(stack)
|
if stacklevel >= 10000 {
|
||||||
if stacklevel > 10000 {
|
|
||||||
return nil, ArErr{
|
return nil, ArErr{
|
||||||
TYPE: "RuntimeError",
|
TYPE: "RuntimeError",
|
||||||
message: "stack overflow",
|
message: "stack overflow",
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +13,6 @@ type UNPARSEcode struct {
|
|||||||
|
|
||||||
// returns (number | string | nil), success, error, step
|
// returns (number | string | nil), success, error, step
|
||||||
func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine int) (any, bool, ArErr, int) {
|
func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine int) (any, bool, ArErr, int) {
|
||||||
fmt.Println(code)
|
|
||||||
if isLine == 2 {
|
if isLine == 2 {
|
||||||
if isDeleteVariable(code) {
|
if isDeleteVariable(code) {
|
||||||
return parseDelete(code, index, codelines)
|
return parseDelete(code, index, codelines)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
@@ -164,7 +163,6 @@ func parseSetVariable(code UNPARSEcode, index int, lines []UNPARSEcode, isLine i
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parseAutoAsignVariable(code UNPARSEcode, index int, lines []UNPARSEcode, isLine int) (setVariable, bool, ArErr, int) {
|
func parseAutoAsignVariable(code UNPARSEcode, index int, lines []UNPARSEcode, isLine int) (setVariable, bool, ArErr, int) {
|
||||||
fmt.Println("autoasign", code.code)
|
|
||||||
trim := strings.TrimSpace(code.code)
|
trim := strings.TrimSpace(code.code)
|
||||||
equalsplit := strings.SplitN(trim, "=", 2)
|
equalsplit := strings.SplitN(trim, "=", 2)
|
||||||
name := strings.TrimSpace(equalsplit[0])
|
name := strings.TrimSpace(equalsplit[0])
|
||||||
@@ -193,7 +191,6 @@ func parseAutoAsignVariable(code UNPARSEcode, index int, lines []UNPARSEcode, is
|
|||||||
if !success {
|
if !success {
|
||||||
return setVariable{}, false, err, i
|
return setVariable{}, false, err, i
|
||||||
}
|
}
|
||||||
fmt.Println("autoasign", code.code, "success")
|
|
||||||
return setVariable{TYPE: "auto", toset: toset, value: value, function: function, params: params, line: code.line, code: code.code, path: code.path}, true, ArErr{}, i + namei - 1
|
return setVariable{TYPE: "auto", toset: toset, value: value, function: function, params: params, line: code.line, code: code.code, path: code.path}, true, ArErr{}, i + namei - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user