// ReadSliceWithoutTag from the reader
170666
func (r *Reader) ReadSliceWithoutTag() []reflect.Value {
	l := r.ReadCount()
	v := make([]reflect.Value, l)
	if !r.Simple {
		setReaderRef(r, nil)
	}
	for i := 0; i < l; i++ {
		v[i] = reflect.New(interfaceType).Elem()
		r.ReadValue(v[i])
	}
	r.readByte()
	return v
}
1044172
func (f *Field) RemoveTag(tag string) FieldInterface {
	delete(f.tag, tag)
	return f
}
708655
func (r *Reader) ReadBytesWithoutTag() (b []byte) {
	l := r.readLength()
	b = make([]byte, l)
	if _, err := r.Read(b); err != nil {
		panic(err)
	}
	r.readByte()
	if !r.Simple {
		setReaderRef(r, b)
	}
	return
}
908174
func (t *table) readTags(tags models.Tags) {
	for j := range t.tags {
		t.tags[j] = t.defs[j]
	}

	if len(tags) == 0 {
		return
	}

	for _, tag := range tags {
		j := execute.ColIdx(string(tag.Key), t.cols)
		t.tags[j] = tag.Value
	}
}
506180
func NewLineTypeTable(tags core.TagSlice) (Table, error) {
	table := make(Table)

	tableSlices, err := TableEntryTags(tags)
	if err != nil {
		return table, err
	}

	for _, slice := range tableSlices {
		ltype, err := NewLineType(slice)
		if err != nil {
			return nil, err
		}
		table[ltype.Name] = ltype
	}

	return table, nil
}
615500
func (c *Manager) GetTagsForCategory(ctx context.Context, id string) ([]Tag, error) {
	ids, err := c.ListTagsForCategory(ctx, id)
	if err != nil {
		return nil, err
	}

	var tags []Tag
	for _, id := range ids {
		tag, err := c.GetTag(ctx, id)
		if err != nil {
			return nil, fmt.Errorf("get tag %s: %s", id, err)
		}

		tags = append(tags, *tag)
	}
	return tags, nil
}
383845
func (z *Tokenizer) readTagName() {
	z.data.start = z.raw.end - 1
	for {
		c := z.readByte()
		if z.err != nil {
			z.data.end = z.raw.end
			return
		}
		switch c {
		case ' ', '\n', '\r', '\t', '\f':
			z.data.end = z.raw.end - 1
			return
		case '/', '>':
			z.raw.end--
			z.data.end = z.raw.end
			return
		}
	}
}
304615
func (s *storeImpl) SearchLibraryByTag(ctx datastore.Context, library, tag string) ([]Image, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("ImageRegistryStore.SearchLibraryByTag"))
	if library = strings.TrimSpace(library); library == "" {
		return nil, errors.New("empty library not allowed")
	} else if tag = strings.TrimSpace(tag); tag == "" {
		return nil, errors.New("empty tag not allowed")
	}
	search := search.Search("controlplane").Type(kind).Size("50000").Filter(
		"and",
		search.Filter().Terms("Library", library),
		search.Filter().Terms("Tag", tag),
	)
	q := datastore.NewQuery(ctx)
	results, err := q.Execute(search)
	if err != nil {
		return nil, err
	}
	return convert(results)
}
1251162
func (c IndexEntries) StringByTag(tag int) string {
	s := c.StringsByTag(tag)
	if s == nil || len(s) == 0 {
		return ""
	}
	return s[0]
}
1328417
func (p *Parser) WrapUntilTag(names ...string) (*NodeWrapper, *Parser, *Error) {
	wrapper := &NodeWrapper{}

	var tagArgs []*Token

	for p.Remaining() > 0 {
		// New tag, check whether we have to stop wrapping here
		if p.Peek(TokenSymbol, "{%") != nil {
			tagIdent := p.PeekTypeN(1, TokenIdentifier)

			if tagIdent != nil {
				// We've found a (!) end-tag

				found := false
				for _, n := range names {
					if tagIdent.Val == n {
						found = true
						break
					}
				}

				// We only process the tag if we've found an end tag
				if found {
					// Okay, endtag found.
					p.ConsumeN(2) // '{%' tagname

					for {
						if p.Match(TokenSymbol, "%}") != nil {
							// Okay, end the wrapping here
							wrapper.Endtag = tagIdent.Val
							return wrapper, newParser(p.template.name, tagArgs, p.template), nil
						}
						t := p.Current()
						p.Consume()
						if t == nil {
							return nil, nil, p.Error("Unexpected EOF.", p.lastToken)
						}
						tagArgs = append(tagArgs, t)
					}
				}
			}

		}

		// Otherwise process next element to be wrapped
		node, err := p.parseDocElement()
		if err != nil {
			return nil, nil, err
		}
		wrapper.nodes = append(wrapper.nodes, node)
	}

	return nil, nil, p.Error(fmt.Sprintf("Unexpected EOF, expected tag %s.", strings.Join(names, " or ")),
		p.lastToken)
}
1254474
func (r *Reader) CheckTag(expectTag byte) (tag byte) {
	tag = r.readByte()
	if tag != expectTag {
		unexpectedTag(tag, []byte{expectTag})
	}
	return
}
120063
func (tn *tagNode) ProcessWith(p Processor) error {
	if err := p.OpenTag(tn.tag); err != nil {
		return err
	}
	for _, child := range tn.children {
		if err := child.ProcessWith(p); err != nil {
			return err
		}
	}
	return p.CloseTag(tn.tag)
}
1227476
func (slice TagSlice) TagIndex(tagCode int, startingIndex int, endIndex int) int {
	for index := startingIndex; index < endIndex; index++ {
		if slice[index].Code == tagCode {
			return index
		}
	}
	return -1
}
368240
func ReadTagFile(name string) (*TagFile, []error) {
	var errs []error

	file, err := os.Open(name)
	if err != nil {
		return nil, append(errs, err)
	}
	defer file.Close()

	tf, err := NewTagFile(name)
	if err != nil {
		return nil, append(errs, err)
	}

	data, errs := parseTagFields(file)
	tf.Data.SetFields(data)

	return tf, errs
}
1348174
func (w *standardSMLWriter) OpenTag(tag []string) error {
	return w.context.Writef("{%s", strings.Join(tag, ":"))
}
652570
func (mp *TxPool) RemoveOrphansByTag(tag Tag) uint64 {
	var numEvicted uint64
	mp.mtx.Lock()
	for _, otx := range mp.orphans {
		if otx.tag == tag {
			mp.removeOrphan(otx.tx, true)
			numEvicted++
		}
	}
	mp.mtx.Unlock()
	return numEvicted
}
241682
func WithTag(name Named, tag string) (NamedTagged, error) {
	r, err := reference.WithTag(name, tag)
	if err != nil {
		return nil, err
	}
	return &taggedRef{namedRef{r}}, nil
}