From 6dd43dc30e6c4027c18e61cd64576dccc10fbc1d Mon Sep 17 00:00:00 2001
From: Danis Kirasirov <dbgbbu@gmail.com>
Date: Tue, 23 Jan 2024 11:06:17 +0300
Subject: [PATCH] add comment

---
 pkg/expr/mongo.go | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pkg/expr/mongo.go b/pkg/expr/mongo.go
index 8ff04088..84471cce 100644
--- a/pkg/expr/mongo.go
+++ b/pkg/expr/mongo.go
@@ -643,6 +643,8 @@ func (c *compiler) PairNode(node *ast.PairNode) interface{} {
 	//c.compile(node.Value)
 }
 
+// notinPatcher проходит по лексемам ast-дерева
+// и объединяет лексемы "not" и "in" в "not in"
 type notinPatcher struct{}
 
 func (t notinPatcher) Visit(node *ast.Node) {
@@ -651,14 +653,14 @@ func (t notinPatcher) Visit(node *ast.Node) {
 		return
 	}
 
-	inNode, ok := nodeNot.Node.(*ast.BinaryNode)
-	if !ok || inNode.Operator != "in" {
+	nodeIn, ok := nodeNot.Node.(*ast.BinaryNode)
+	if !ok || nodeIn.Operator != "in" {
 		return
 	}
 	
 	nodeNot.Operator = ""
 	ast.Patch(node, nodeNot)
 
-	inNode.Operator = "not in"
-	ast.Patch(&nodeNot.Node, inNode)
+	nodeIn.Operator = "not in"
+	ast.Patch(&nodeNot.Node, nodeIn)
 }
\ No newline at end of file
-- 
GitLab