make it so its possible to negate a functions value without needing brackets

This commit is contained in:
2024-10-08 15:13:58 +01:00
parent 4910a2337b
commit 55db84fcce
2 changed files with 5 additions and 3 deletions

View File

@@ -156,6 +156,7 @@ func translateImport(realpath string, origin string, topLevelOnly bool) (transla
importing[p] = true importing[p] = true
translated, translationerr := translate(codelines) translated, translationerr := translate(codelines)
debugPrintln(translated...)
importing[p] = false importing[p] = false
if translationerr.EXISTS { if translationerr.EXISTS {

View File

@@ -139,6 +139,9 @@ func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine i
return nil, worked, err, step return nil, worked, err, step
} }
} }
if isNegative(code) {
return parseNegative(code, index, codelines)
}
if !QuickKnownFailures["call"+code.code] && isCall(code) { if !QuickKnownFailures["call"+code.code] && isCall(code) {
resp, worked, err, i = parseCall(code, index, codelines) resp, worked, err, i = parseCall(code, index, codelines)
if worked { if worked {
@@ -146,9 +149,7 @@ func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine i
} }
QuickKnownFailures["call"+code.code] = true QuickKnownFailures["call"+code.code] = true
} }
if isNegative(code) { if isMapGet(code) {
return parseNegative(code, index, codelines)
} else if isMapGet(code) {
return mapGetParse(code, index, codelines) return mapGetParse(code, index, codelines)
} else if !QuickKnownFailures["indexget"+code.code] && isIndexGet(code) { } else if !QuickKnownFailures["indexget"+code.code] && isIndexGet(code) {
resp, worked, err, i = indexGetParse(code, index, codelines) resp, worked, err, i = indexGetParse(code, index, codelines)