mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
fix operations being ignored as syntax error when multiple minuses
This commit is contained in:
@@ -11,6 +11,8 @@ import (
|
|||||||
var imported = make(map[string]ArObject)
|
var imported = make(map[string]ArObject)
|
||||||
var importing = make(map[string]bool)
|
var importing = make(map[string]bool)
|
||||||
|
|
||||||
|
var modules_folder = "argon_modules"
|
||||||
|
|
||||||
func FileExists(filename string) bool {
|
func FileExists(filename string) bool {
|
||||||
if _, err := os.Stat(filename); err == nil {
|
if _, err := os.Stat(filename); err == nil {
|
||||||
return true
|
return true
|
||||||
@@ -73,13 +75,13 @@ func importMod(realpath string, origin string, main bool, global ArObject) (ArOb
|
|||||||
pathsToTest = []string{
|
pathsToTest = []string{
|
||||||
filepath.Join(origin, realpath, "init.ar"),
|
filepath.Join(origin, realpath, "init.ar"),
|
||||||
filepath.Join(origin, path),
|
filepath.Join(origin, path),
|
||||||
filepath.Join(origin, "modules", path),
|
filepath.Join(origin, modules_folder, path),
|
||||||
filepath.Join(origin, "modules", realpath, "init.ar"),
|
filepath.Join(origin, modules_folder, realpath, "init.ar"),
|
||||||
filepath.Join(ex, path),
|
filepath.Join(ex, path),
|
||||||
filepath.Join(ex, "modules", realpath, "init.ar"),
|
filepath.Join(ex, modules_folder, realpath, "init.ar"),
|
||||||
filepath.Join(ex, "modules", path),
|
filepath.Join(ex, modules_folder, path),
|
||||||
filepath.Join(executable, "modules", realpath, "init.ar"),
|
filepath.Join(executable, modules_folder, realpath, "init.ar"),
|
||||||
filepath.Join(executable, "modules", path),
|
filepath.Join(executable, modules_folder, path),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,9 +66,6 @@ func parseOperations(code UNPARSEcode, index int, codelines []UNPARSEcode) (oper
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for k := 0; k < len(split)-1; k++ {
|
for k := 0; k < len(split)-1; k++ {
|
||||||
if len(strings.TrimSpace(split[k])) == 0 || len(strings.TrimSpace(split[k+1])) == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
val1, worked, err, step1 := translateVal(UNPARSEcode{
|
val1, worked, err, step1 := translateVal(UNPARSEcode{
|
||||||
code: strings.Join(split[:k+1], operations[i][j]),
|
code: strings.Join(split[:k+1], operations[i][j]),
|
||||||
realcode: code.realcode,
|
realcode: code.realcode,
|
||||||
@@ -79,6 +76,9 @@ func parseOperations(code UNPARSEcode, index int, codelines []UNPARSEcode) (oper
|
|||||||
if k == len(split)-1 {
|
if k == len(split)-1 {
|
||||||
return operationType{}, false, err, 0
|
return operationType{}, false, err, 0
|
||||||
} else {
|
} else {
|
||||||
|
if len(strings.TrimSpace(split[k])) == 0 || len(strings.TrimSpace(split[k+1])) == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,6 +93,9 @@ func parseOperations(code UNPARSEcode, index int, codelines []UNPARSEcode) (oper
|
|||||||
if k == len(split)-1 {
|
if k == len(split)-1 {
|
||||||
return operationType{}, false, err, 0
|
return operationType{}, false, err, 0
|
||||||
} else {
|
} else {
|
||||||
|
if len(strings.TrimSpace(split[k])) == 0 || len(strings.TrimSpace(split[k+1])) == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user