Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
6dd43dc3
Commit
6dd43dc3
authored
1 year ago
by
Danis Kirasirov
Browse files
Options
Downloads
Patches
Plain Diff
add comment
parent
9c1dec9f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/expr/mongo.go
+6
-4
6 additions, 4 deletions
pkg/expr/mongo.go
with
6 additions
and
4 deletions
pkg/expr/mongo.go
+
6
−
4
View file @
6dd43dc3
...
@@ -643,6 +643,8 @@ func (c *compiler) PairNode(node *ast.PairNode) interface{} {
...
@@ -643,6 +643,8 @@ func (c *compiler) PairNode(node *ast.PairNode) interface{} {
//c.compile(node.Value)
//c.compile(node.Value)
}
}
// notinPatcher проходит по лексемам ast-дерева
// и объединяет лексемы "not" и "in" в "not in"
type
notinPatcher
struct
{}
type
notinPatcher
struct
{}
func
(
t
notinPatcher
)
Visit
(
node
*
ast
.
Node
)
{
func
(
t
notinPatcher
)
Visit
(
node
*
ast
.
Node
)
{
...
@@ -651,14 +653,14 @@ func (t notinPatcher) Visit(node *ast.Node) {
...
@@ -651,14 +653,14 @@ func (t notinPatcher) Visit(node *ast.Node) {
return
return
}
}
inN
ode
,
ok
:=
nodeNot
.
Node
.
(
*
ast
.
BinaryNode
)
n
ode
In
,
ok
:=
nodeNot
.
Node
.
(
*
ast
.
BinaryNode
)
if
!
ok
||
inN
ode
.
Operator
!=
"in"
{
if
!
ok
||
n
ode
In
.
Operator
!=
"in"
{
return
return
}
}
nodeNot
.
Operator
=
""
nodeNot
.
Operator
=
""
ast
.
Patch
(
node
,
nodeNot
)
ast
.
Patch
(
node
,
nodeNot
)
inN
ode
.
Operator
=
"not in"
n
ode
In
.
Operator
=
"not in"
ast
.
Patch
(
&
nodeNot
.
Node
,
inN
ode
)
ast
.
Patch
(
&
nodeNot
.
Node
,
n
ode
In
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment