// newExprIterFromGroupExpr creates the iterator on the Group expression.
349322
func newExprIterFromGroupExpr(expr *GroupExpr, p *Pattern) *ExprIter {
	if len(p.Children) != len(expr.Children) {
		return nil
	}

	iter := &ExprIter{Operand: p.Operand, matched: true}
	for i := range p.Children {
		childIter := newExprIterFromGroup(expr.Children[i], p.Children[i])
		if childIter == nil {
			return nil
		}
		iter.Children = append(iter.Children, childIter)
	}
	return iter
}
89077
func NewKeyValueExpr(k, v Expr, pos Pos) *KeyValueExpr {
	return &KeyValueExpr{pos, k, v}
}
991268
func NewExpression(Expr node.Node) *Expression {
	return &Expression{
		FreeFloating: nil,
		Expr:         Expr,
	}
}
313586
func NewFilterExpr(name string, args []Expr, pos Pos) *FilterExpr {
	return &FilterExpr{NewFuncExpr(name, args, pos)}
}
138197
func NewGroupRenameType(Description string) *GroupRenameType {
	s := new(GroupRenameType)
	s.Description = Description
	return s
}
543550
func NewGroupChangeExternalIdDetails(NewValue string, PreviousValue string) *GroupChangeExternalIdDetails {
	s := new(GroupChangeExternalIdDetails)
	s.NewValue = NewValue
	s.PreviousValue = PreviousValue
	return s
}
1120473
func (p *printer) expr(x ast.Expr, multiLine *bool) {
	const depth = 1
	p.expr1(x, token.LowestPrec, depth, multiLine)
}
947636
func newGenerator(regexp *syntax.Regexp, args *GeneratorArgs) (generator *internalGenerator, err error) {
	simplified := regexp.Simplify()

	factory, ok := generatorFactories[simplified.Op]
	if ok {
		return factory(simplified, args)
	}

	return nil, fmt.Errorf("invalid generator pattern: /%s/ as /%s/\n%s",
		regexp, simplified, inspectRegexpToString(simplified))
}
643755
func NewFuncExpr(name string, args []Expr, pos Pos) *FuncExpr {
	return &FuncExpr{pos, name, args}
}
962572
func lexExpr(name, input string) *lexer {
	l := &lexer{
		name:  name,
		input: input,
		items: make(chan item),
		state: lexInsideTag,
	}
	go l.run()
	return l
}
1018744
func NewGroupMembersAddArg(Group *GroupSelector, Members []*MemberAccess) *GroupMembersAddArg {
	s := new(GroupMembersAddArg)
	s.Group = Group
	s.Members = Members
	s.ReturnMembers = true
	return s
}
575634
func (iter *ExprIter) Next() (found bool) {
	defer func() {
		iter.matched = found
	}()

	// Iterate child firstly.
	for i := len(iter.Children) - 1; i >= 0; i-- {
		if !iter.Children[i].Next() {
			continue
		}

		for j := i + 1; j < len(iter.Children); j++ {
			iter.Children[j].Reset()
		}
		return true
	}

	// It's root node.
	if iter.Group == nil {
		return false
	}

	// Otherwise, iterate itself to find more matched equivalent expressions.
	for elem := iter.Element.Next(); elem != nil; elem = elem.Next() {
		expr := elem.Value.(*GroupExpr)
		exprOperand := GetOperand(expr.ExprNode)

		if !iter.Operand.Match(exprOperand) {
			// All the Equivalents which have the same Operand are continuously
			// stored in the list. Once the current equivalent can not Match
			// the Operand, the rest can not, either.
			return false
		}

		if len(iter.Children) != len(expr.Children) {
			continue
		}

		allMatched := true
		for i := range iter.Children {
			iter.Children[i].Group = expr.Children[i]
			if !iter.Children[i].Reset() {
				allMatched = false
				break
			}
		}

		if allMatched {
			iter.Element = elem
			return true
		}
	}
	return false
}
327982
func Expr(expression string, args ...interface{}) *expr {
	return &expr{expr: expression, args: args}
}
603159
func (q *Query) OrderExpr(order string, params ...interface{}) *Query {
	if order != "" {
		q.order = append(q.order, &queryParamsAppender{order, params})
	}
	return q
}
317579
func (p *parser) parseAdditiveExpr(n node) node {
	opnd := p.parseMultiplicativeExpr(n)
Loop:
	for {
		var op string
		switch p.r.typ {
		case itemPlus:
			op = "+"
		case itemMinus:
			op = "-"
		default:
			break Loop
		}
		p.next()
		opnd = newOperatorNode(op, opnd, p.parseMultiplicativeExpr(n))
	}
	return opnd
}
354902
func (c *Config) NewIteratorGlob(regexp string) (*ConfigIterator, error) {
	iter := &ConfigIterator{cfg: c}
	cregexp := C.CString(regexp)
	defer C.free(unsafe.Pointer(cregexp))

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_config_iterator_glob_new(&iter.ptr, c.ptr, cregexp)
	if ret < 0 {
		return nil, MakeGitError(ret)
	}

	return iter, nil
}
451365
func NewGroupRemoveExternalIdType(Description string) *GroupRemoveExternalIdType {
	s := new(GroupRemoveExternalIdType)
	s.Description = Description
	return s
}