// WriteSymbol writes the symbol using the provided prefix Encoder.
436723
func (pw *Writer) WriteSymbol(sym uint, pe *Encoder) {
	if _, err := pw.PushBits(); err != nil {
		errors.Panic(err)
	}
	chunk := pe.chunks[uint32(sym)&pe.chunkMask]
	nb := uint(chunk & countMask)
	pw.bufBits |= uint64(chunk>>countBits) << pw.numBits
	pw.numBits += nb
}
135839
func (cae *CoordinatesArrayElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, cae)
}
609814
func (nw *NullIO) Write(v []byte) (int, error) {
	return len(v), nil
}
496352
func (w *writeCloseInformer) Write(p []byte) (int, error) {
	return w.wc.Write(p)
}
87581
func (enc *Encoder) WriteInt8(val int8) error {
	return enc.WriteInt(int(val))
}
163981
func (cfe *CoordinatesFlatElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, cfe)
}
498136
func Write(x int, y int, text string, fg termbox.Attribute, bg termbox.Attribute) {
	//runeCount := utf8.RuneCountInString(text)
	pos := x
	for _, r := range text {
		termbox.SetCell(pos, y, r, fg, bg)
		pos++
	}
}
149659
func (e *IntegerEncoder) Write(v int64) {
	// Delta-encode each value as it's written.  This happens before
	// ZigZagEncoding because the deltas could be negative.
	delta := v - e.prev
	e.prev = v
	enc := ZigZagEncode(delta)
	if len(e.values) > 1 {
		e.rle = e.rle && e.values[len(e.values)-1] == enc
	}

	e.values = append(e.values, enc)
}
47578
func (br *bitReader) TryReadSymbol(pd *prefixDecoder) (uint, bool) {
	if br.numBits < uint(pd.minBits) || len(pd.chunks) == 0 {
		return 0, false
	}
	chunk := pd.chunks[uint32(br.bufBits)&pd.chunkMask]
	nb := uint(chunk & prefixCountMask)
	if nb > br.numBits || nb > uint(pd.chunkBits) {
		return 0, false
	}
	br.bufBits >>= nb
	br.numBits -= nb
	return uint(chunk >> prefixCountBits), true
}
896095
func (enc *Encoder) writeBytes(p []byte) {
	enc.buf = append(enc.buf, p...)
}
616978
func ReadSymbol(r *bufio.Reader) Value {
	ReadWhitespace(r)
	result := ReadDataUntil(r, isNotSymbolCharacter)
	return Symbol(result)
}
781913
func (se *SimpleElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, se)
}
303533
func (w yamlFrameWriter) Write(data []byte) (n int, err error) {
	if _, err := w.w.Write([]byte("---\n")); err != nil {
		return 0, err
	}
	return w.w.Write(data)
}
1241825
func MakeSymbolTable(def Definition, types ...string) (map[rune]bool, error) {
	symbols := def.Symbols()
	table := map[rune]bool{}
	for _, symbol := range types {
		rn, ok := symbols[symbol]
		if !ok {
			return nil, fmt.Errorf("lexer does not support symbol %q", symbol)
		}
		table[rn] = true
	}
	return table, nil
}
310386
func NewWriter(prefix string, flags int, handler events.Handler) *Writer {
	return &Writer{
		handler: handler,
		prefix:  prefix,
		flags:   flags,
	}
}
368510
func EncodeSLEB128(out io.ByteWriter, x int64) {
	for {
		b := byte(x & 0x7f)
		x >>= 7

		signb := b & 0x40

		last := false
		if (x == 0 && signb == 0) || (x == -1 && signb != 0) {
			last = true
		} else {
			b = b | 0x80
		}
		out.WriteByte(b)

		if last {
			break
		}
	}
}
818814
func (w *encbuf) Write(b []byte) (int, error) {
	w.str = append(w.str, b...)
	return len(b), nil
}