func (es *Events) AddTrace(x interface{}) {
	es.Traces.Add(x)
}
AddTrace adds the given thing to the list of traces.
package core
import (
	"context"
	"encoding/json"
	"errors"
	. "github.com/Comcast/sheens/match"
)
var (
	TracesInitialCap = 16
	EmittedMessagesInitialCap = 16
	DefaultControl = &Control{
		Limit: 100,
	}
	Exp_BranchTargetVariables = true
)
type StepProps map[string]interface{}
func (ps StepProps) Copy() StepProps {
	acc := make(StepProps, len(ps))
	for p, v := range ps {
		acc[p] = v
	}
	return acc
}
type StopReason int
const (
	Done              StopReason = iota  
	Limited                              
	InternalError                        
	BreakpointReached                    
)
type State struct {
	NodeName string   `json:"node"`
	Bs       Bindings `json:"bs"`
}
func (s *State) String() string {
	if s == nil {
		return "nil"
	}
	js, err := json.Marshal(s.Bs)
	if err != nil {
		return s.NodeName + "/{*}"
	}
	return s.NodeName + "/" + string(js)
}
func (s *State) Copy() *State {
	return &State{
		NodeName: s.NodeName,
		Bs:       s.Bs.Copy(),
	}
}
type Breakpoint func(context.Context, *State) bool
type Control struct {
	Limit       int                   `json:"limit"`
	Breakpoints map[string]Breakpoint `json:"-"`
}
func (c *Control) Copy() *Control {
	bs := make(map[string]Breakpoint, len(c.Breakpoints))
	for id, b := range c.Breakpoints {
		bs[id] = b
	}
	return &Control{
		Limit:       c.Limit,
		Breakpoints: bs,
	}
}
type Traces struct {
	Messages []interface{} `json:"messages,omitempty" yaml:",omitempty"`
}
func NewTraces() *Traces {
	return &Traces{
		Messages: make([]interface{}, 0, TracesInitialCap),
	}
}
func (ts *Traces) Add(xs ...interface{}) {
	ts.Messages = append(ts.Messages, xs...)
}
type Events struct {
	Emitted []interface{} `json:"emitted,omitempty" yaml:",omitempty"`
	Traces  *Traces       `json:"traces,omitempty" yaml:",omitempty"`
}
func newEvents() *Events {
	return &Events{
		Emitted: make([]interface{}, 0, EmittedMessagesInitialCap),
		Traces:  NewTraces(),
	}
}
func (es *Events) AddEmitted(x interface{}) {
	es.Emitted = append(es.Emitted, x)
}