From ce3cd1065db6a1c01bb1a7d5d8b3613f397683b4 Mon Sep 17 00:00:00 2001 From: mappu Date: Fri, 10 Apr 2020 20:07:57 +1200 Subject: [PATCH] node: implement *expr.BooleanNot --- node.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/node.go b/node.go index 82d3fb9..9fb2cf8 100644 --- a/node.go +++ b/node.go @@ -1082,6 +1082,14 @@ func (this *conversionState) convertNoFreeFloating(n_ node.Node) (string, error) case *expr.ShortArray: return this.convertArrayLiteralCommon(n.Items) + case *expr.BooleanNot: + rhs, err := this.convert(n.Expr) + if err != nil { + return "", parseErr{n, err} + } + + return "!(" + rhs + ")", nil + case *expr.ArrayDimFetch: // Might be x[foo], might be x[] (i.e. append() call) // In order to make the append() transformation, we need to lookahead