From 55db84fcce7d98993a2e5f5ad3e528ae2e87fdb8 Mon Sep 17 00:00:00 2001 From: William Bell Date: Tue, 8 Oct 2024 15:13:58 +0100 Subject: [PATCH] make it so its possible to negate a functions value without needing brackets --- src/import.go | 1 + src/translate.go | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/import.go b/src/import.go index f3f4e59..4a2557e 100644 --- a/src/import.go +++ b/src/import.go @@ -156,6 +156,7 @@ func translateImport(realpath string, origin string, topLevelOnly bool) (transla importing[p] = true translated, translationerr := translate(codelines) + debugPrintln(translated...) importing[p] = false if translationerr.EXISTS { diff --git a/src/translate.go b/src/translate.go index a295bb5..bd37a9b 100644 --- a/src/translate.go +++ b/src/translate.go @@ -139,6 +139,9 @@ func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine i return nil, worked, err, step } } + if isNegative(code) { + return parseNegative(code, index, codelines) + } if !QuickKnownFailures["call"+code.code] && isCall(code) { resp, worked, err, i = parseCall(code, index, codelines) if worked { @@ -146,9 +149,7 @@ func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine i } QuickKnownFailures["call"+code.code] = true } - if isNegative(code) { - return parseNegative(code, index, codelines) - } else if isMapGet(code) { + if isMapGet(code) { return mapGetParse(code, index, codelines) } else if !QuickKnownFailures["indexget"+code.code] && isIndexGet(code) { resp, worked, err, i = indexGetParse(code, index, codelines)