// SymbolIndex returns the index of the symbol s in Symbol or -1 if not found.
496767
func SymbolIndex(s int) (idx int) {
	for idx = 0; idx < len(Symbol); idx++ {
		if Symbol[idx] == s {
			return idx
		}
	}
	return -1
}
558776
func (s *CatIndicesService) Index(index string) *CatIndicesService {
	s.index = index
	return s
}
882972
func (m *Match) matchIndex(cap int) int {
	i := m.matches[cap][m.matchcount[cap]*2-2]
	if i >= 0 {
		return i
	}

	return m.matches[cap][-3-i]
}
50356
func (s *ReindexService) SourceIndex(index string) *ReindexService {
	if s.source == nil {
		s.source = NewReindexSource()
	}
	s.source = s.source.Index(index)
	return s
}
166221
func NextSymbol(s int) int {
	if idx := SymbolIndex(s); idx != -1 {
		return Symbol[(idx+1)%len(Symbol)]
	}
	return s + 1
}
304337
func (v List) Index(i int) Value {
	if !(0 <= i && i < len(v)) {
		return Undefined{}
	}
	return v[i]
}
500010
func (s *IndicesAnalyzeService) Index(index string) *IndicesAnalyzeService {
	s.index = index
	return s
}
1281849
func (s *IndicesOpenService) Index(index string) *IndicesOpenService {
	s.index = index
	return s
}
47730
func (s *IndicesUnfreezeService) Index(index string) *IndicesUnfreezeService {
	s.index = index
	return s
}
151941
func (c *ComparableResources) NetIndex(n *NetworkResource) int {
	return c.Flattened.Networks.NetIndex(n)
}
765961
func (t Term) AtIndex(args ...interface{}) Term {
	return constructMethodTerm(t, "AtIndex", p.Term_BRACKET, args, map[string]interface{}{})
}
779313
func (table *Table) AddIndex(index *Index) {
	table.Indexes[index.Name] = index
}
1329973
func (l *list) FindIndex(pred func(interface{}) bool) int {
	curr := l
	idx := 0
	for {
		if pred(curr.head) {
			return idx
		}
		tail, _ := curr.Tail()
		if tail.IsEmpty() {
			return -1
		}
		curr = tail.(*list)
		idx += 1
	}
}
1043910
func (me *seq) DeleteIndex(index int) {
	me.i[index] = me.Index(me.Len() - 1)
	me.i = me.i[:me.Len()-1]
}
1368018
func searchIndex(names []string, index uint64) (int, bool) {
	for i := len(names) - 1; i >= 0; i-- {
		name := names[i]
		_, curIndex, err := parseWalName(name)
		if err != nil {
			plog.Panicf("parse correct name should never fail: %v", err)
		}
		if index >= curIndex {
			return i, true
		}
	}
	return -1, false
}
1339417
func (h *Holder) Index(name string) *Index {
	h.mu.RLock()
	defer h.mu.RUnlock()
	return h.index(name)
}
606751
func (p *Parser) Index() bool {

	if p.PeekByte() != '[' {
		return false
	}
	p.Byte()

	i := p.ev.Level()

	p.ev.Add(TypeIndex)
	p.ev.Inc()

	p.Space()
	p.Expression()
	p.Space()

	if p.PeekByte() != ']' {
		return false // error
	}
	p.Byte()

	// Level before and after is the same
	p.ev.SetLevel(i)
	return true
}