node: implement *expr.BooleanNot

This commit is contained in:
mappu 2020-04-10 20:07:57 +12:00
parent 199654f552
commit ce3cd1065d
1 changed files with 8 additions and 0 deletions

View File

@ -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