forked from chuckpreslar/codex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrouping.go
More file actions
29 lines (24 loc) · 808 Bytes
/
grouping.go
File metadata and controls
29 lines (24 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package codex
// Grouping node is a Unary node struct
type GroupingNode UnaryNode
// Returns a Grouping node with an expression containing a
// reference to an Or node of the Grouping and other.
func (self *GroupingNode) Or(other interface{}) *GroupingNode {
return Grouping(Or(self, other))
}
// Returns a Grouping node with an expression containing a
// reference to an And node of the Grouping and other.
func (self *GroupingNode) And(other interface{}) *GroupingNode {
return Grouping(And(self, other))
}
// Returns an Not node with and expression containing the
// Grouping node.
func (self *GroupingNode) Not() *NotNode {
return Not(self)
}
// GroupingNode factory method.
func Grouping(expr interface{}) (grouping *GroupingNode) {
grouping = new(GroupingNode)
grouping.Expr = expr
return
}