// Emits a zero-argument operation. Note that the emit
// functions all run in two modes: they can emit code, or
// they can just count the size of the code.
490646
func (w *writer) emit(op InstOp) {
	if w.counting {
		w.count++
		if opcodeBacktracks(op) {
			w.trackcount++
		}
		return
	}
	w.emitted[w.curpos] = int(op)
	w.curpos++
}
1332470
func (e *eventEmitter) emit(typ EventType, data interface{}) {
	ev := Event{Type: typ, Packet: data}

	e.lock.Lock()
	lists := [][]EventHandler{}
	if handlers, ok := e.listeners[ev.Type]; ok {
		lists = append(lists, handlers)
	}
	if handlers, ok := e.once[ev.Type]; ok {
		lists = append(lists, handlers)
		delete(e.once, ev.Type)
	}
	e.lock.Unlock()

	for _, list := range lists {
		for _, handler := range list {
			go handler(ev)
		}
	}
}
550991
func (k *KafkaLogEmitter) Emit(logLine *avro.LogLine) {
	if logLine.Logtypeid.(int64) >= logLevels[k.config.LogLevel] {
		k.producer.Send(&producer.ProducerRecord{
			Topic: k.config.Topic,
			Value: logLine,
		})
	}
}
343531
func (s *Server) Go(id interface{}, args ...interface{}) {
	f := s.functions[id]
	if f == nil {
		return
	}

	defer func() {
		recover()
	}()

	s.ChanCall <- &CallInfo{
		f:    f,
		args: args,
	}
}
576752
func emitCopy(dst []byte, offset, length int) int {
	i := 0
	for length > 0 {
		x := length - 4
		if 0 <= x && x < 1<<3 && offset < 1<<11 {
			dst[i+0] = uint8(offset>>8)&0x07<<5 | uint8(x)<<2 | tagCopy1
			dst[i+1] = uint8(offset)
			i += 2
			break
		}

		x = length
		if x > 1<<6 {
			x = 1 << 6
		}
		dst[i+0] = uint8(x-1)<<2 | tagCopy2
		dst[i+1] = uint8(offset)
		dst[i+2] = uint8(offset >> 8)
		i += 3
		length -= x
	}
	return i
}
30476
func (j *FormatWriterJSON) Emit(logger *Logger, level int, message string, extra Map) {
	sb := bufPool.Get()
	defer bufPool.Put(sb)

	flags := logger.Flags()

	sb.WriteByte('{')
	// if time is being logged, handle time as soon as possible
	if flags&(Ltimestamp|Ltai64n) != 0 {
		t := time.Now()
		sb.WriteString(`"time": "`)
		if flags&Ltai64n != 0 {
			writeTimeTAI64N(sb, &t, flags)
		} else {
			writeTime(sb, &t, flags)
		}
		sb.WriteString(`", `)
	}

	if flags&Llevel != 0 {
		sb.WriteString(`"level": "`)
		switch level {
		case -1:
			sb.WriteByte('D')
		case 1:
			sb.WriteByte('F')
		default:
			sb.WriteByte('I')
		}
		sb.WriteString(`", `)
	}

	if flags&(Lshortfile|Llongfile) != 0 {
		_, file, line, ok := runtime.Caller(3)
		if !ok {
			file = "???"
			line = 0
		}

		if flags&Lshortfile != 0 {
			short := file
			for i := len(file) - 1; i > 0; i-- {
				if file[i] == '/' {
					short = file[i+1:]
					break
				}
			}
			file = short
		}

		sb.WriteString(`"caller": "`)
		sb.WriteString(file)
		sb.WriteByte(':')
		sb.AppendIntWidth(line, 0)
		sb.WriteString(`", `)
	}

	sb.WriteString(`"msg": "`)
	encodeStringJSON(sb, message)
	sb.WriteByte('"')

	if extra != nil && len(extra) > 0 {
		sb.WriteString(`, "extra": {`)
		encodeLogMapJSON(sb, extra)
		sb.WriteByte('}')
	}

	sb.WriteByte('}')
	sb.WriteByte('\n')
	sb.WriteTo(logger)
}
840562
func (l *FormatWriterPlain) Emit(logger *Logger, level int, message string, extra Map) {
	sb := bufPool.Get()
	defer bufPool.Put(sb)

	flags := logger.Flags()

	// if time is being logged, handle time as soon as possible
	if flags&(Ltimestamp|Ltai64n) != 0 {
		t := time.Now()
		if flags&Ltai64n != 0 {
			writeTimeTAI64N(sb, &t, flags)
		} else {
			writeTime(sb, &t, flags)
		}
		sb.WriteByte(' ')
	}

	if flags&Llevel != 0 {
		switch level {
		case -1:
			sb.WriteString(`DEBUG `)
		case 1:
			sb.WriteString(`FATAL `)
		default:
			sb.WriteString(`INFO  `)
		}
	}

	if flags&(Lshortfile|Llongfile) != 0 {
		_, file, line, ok := runtime.Caller(3)
		if !ok {
			file = "???"
			line = 0
		}

		if flags&Lshortfile != 0 {
			short := file
			for i := len(file) - 1; i > 0; i-- {
				if file[i] == '/' {
					short = file[i+1:]
					break
				}
			}
			file = short
		}

		sb.WriteString(file)
		sb.WriteByte(':')
		sb.AppendIntWidth(line, 0)
		sb.WriteByte(' ')
	}

	encodeStringPlain(sb, message)

	if extra != nil && len(extra) > 0 {
		sb.WriteByte(' ')
		if flags&Lsort != 0 {
			extra.sortedWriteBuf(sb)
		} else {
			extra.unsortedWriteBuf(sb)
		}
	}

	sb.WriteByte('\n')
	sb.WriteTo(logger)
}
157115
func (l *Lexer) emitString(delimiter rune) {
	str := l.input[l.start:l.pos]

	// replace escaped delimiters
	str = strings.Replace(str, "\\"+string(delimiter), string(delimiter), -1)

	l.produce(TokenString, str)
}
1074232
func (s *scanner) emitSimple(t tokenType, v string) *token {
	token := &token{t, v, s.row, s.col}
	s.col += len(v)
	s.pos += len(v)
	return token
}
286236
func (e *emitter) Start() {
	if !e.started {
		e.started = true
		e.wg.Add(1)
		go e.startEventListener(&e.wg)
	}
}
105104
func (p *AgentClient) EmitBatch(batch *jaeger.Batch) (err error) {
	if err = p.sendEmitBatch(batch); err != nil {
		return
	}
	return
}
529510
func (cmd *CLI) StdOut() io.Writer {
	if cmd.stdOutput == nil {
		cmd.stdOutput = os.Stdout
	}
	return cmd.stdOutput
}
749133
func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool {
	emitter.events = append(emitter.events, *event)
	for !yaml_emitter_need_more_events(emitter) {
		event := &emitter.events[emitter.events_head]
		if !yaml_emitter_analyze_event(emitter, event) {
			return false
		}
		if !yaml_emitter_state_machine(emitter, event) {
			return false
		}
		yaml_event_delete(event)
		emitter.events_head++
	}
	return true
}
17240
func (self *TimedRotatingFileHandler) Emit(record *LogRecord) error {
	return self.RolloverEmit(self, record)
}
696654
func Main(params Parameters, args []string) int {
	return subcommands.Run(GetApplication(params), fixflagpos.FixSubcommands(args))
}
810915
func (self *RotatingFileHandler) Emit(record *LogRecord) error {
	return self.RolloverEmit(self, record)
}
724421
func emit(ctx *rtmCtx, e *Event) error {
	select {
	case <-ctx.Done():
		return ctx.Err()
	case ctx.inbuf <- e:
		return nil
	}
}