// String returns a readable string representation of a Xtruct
// struct.
510702
func (v *Xtruct) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.StringThing != nil {
		fields[i] = fmt.Sprintf("StringThing: %v", *(v.StringThing))
		i++
	}
	if v.ByteThing != nil {
		fields[i] = fmt.Sprintf("ByteThing: %v", *(v.ByteThing))
		i++
	}
	if v.I32Thing != nil {
		fields[i] = fmt.Sprintf("I32Thing: %v", *(v.I32Thing))
		i++
	}
	if v.I64Thing != nil {
		fields[i] = fmt.Sprintf("I64Thing: %v", *(v.I64Thing))
		i++
	}

	return fmt.Sprintf("Xtruct{%v}", strings.Join(fields[:i], ", "))
}
1166407
func (s *StructStruct) string(n int) string {
	sname := s.Name()
	pad := strings.Repeat(" ", n)

	var res string
	res += fmt.Sprintf("%s%s {\n", pad, sname)

	var fn int
	for _, field := range s.data {
		var n int
		if emb := field.Embedded(); emb != nil {
			n = len(emb.Name())
		} else {
			n = len(field.Name())
		}
		if n > fn {
			fn = n
		}
	}

	f := fmt.Sprintf("%s%%%ds %%T\n", pad, fn+1)
	for _, field := range s.data {
		if emb := field.Embedded(); emb != nil {
			res += emb.string(n + fn)
			continue
		}
		res += fmt.Sprintf(f, field.Name(), field.value.Interface())
	}

	res += fmt.Sprintf("%s}\n", pad)
	return res
}
238149
func (o *OneOrMoreExpr) String() string {
	return fmt.Sprintf("%s: %T{Expr: %v}", o.p, o, o.Expr)
}
530369
func (e *Event) String() string {
	switch e.Type {
	case EventTypeNode:
		return fmt.Sprintf("<node-event> id: %s up: %t", e.Node.ID().TerminalString(), e.Node.Up())
	case EventTypeConn:
		return fmt.Sprintf("<conn-event> nodes: %s->%s up: %t", e.Conn.One.TerminalString(), e.Conn.Other.TerminalString(), e.Conn.Up)
	case EventTypeMsg:
		return fmt.Sprintf("<msg-event> nodes: %s->%s proto: %s, code: %d, received: %t", e.Msg.One.TerminalString(), e.Msg.Other.TerminalString(), e.Msg.Protocol, e.Msg.Code, e.Msg.Received)
	default:
		return ""
	}
}
532280
func (a Atom) String() string {
	start := uint32(a >> 8)
	n := uint32(a & 0xff)
	if start+n > uint32(len(atomText)) {
		return ""
	}
	return atomText[start : start+n]
}
599638
func (t Type) String() string {
	switch t {
	case REQ:
		return "REQ"
	case REP:
		return "REP"
	case DEALER:
		return "DEALER"
	case ROUTER:
		return "ROUTER"
	case PUB:
		return "PUB"
	case SUB:
		return "SUB"
	case XPUB:
		return "XPUB"
	case XSUB:
		return "XSUB"
	case PUSH:
		return "PUSH"
	case PULL:
		return "PULL"
	case PAIR:
		return "PAIR"
	case STREAM:
		return "STREAM"
	}
	return "<INVALID>"
}
549380
func (t *MacroNode) String() string {
	return fmt.Sprintf("Macro %s(%s): %s", t.Name, strings.Join(t.Args, ", "), t.Body)
}
1115298
func (t Type) String() string {
	switch t {
	case REQ:
		return "REQ"
	case REP:
		return "REP"
	case DEALER:
		return "DEALER"
	case ROUTER:
		return "ROUTER"
	case PUB:
		return "PUB"
	case SUB:
		return "SUB"
	case XPUB:
		return "XPUB"
	case XSUB:
		return "XSUB"
	case PUSH:
		return "PUSH"
	case PULL:
		return "PULL"
	case PAIR:
		return "PAIR"
	case STREAM:
		return "STREAM"
	// DRAFT
	case SERVER:
		return "SERVER"
	case CLIENT:
		return "CLIENT"
	case RADIO:
		return "RADIO"
	case DISH:
		return "DISH"
	case GATHER:
		return "GATHER"
	case SCATTER:
		return "SCATTER"
	case DGRAM:
		return "DGRAM"
	}
	return "<INVALID>"
}
593710
func (v *Xception) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.ErrorCode != nil {
		fields[i] = fmt.Sprintf("ErrorCode: %v", *(v.ErrorCode))
		i++
	}
	if v.Message != nil {
		fields[i] = fmt.Sprintf("Message: %v", *(v.Message))
		i++
	}

	return fmt.Sprintf("Xception{%v}", strings.Join(fields[:i], ", "))
}
466801
func (a Addr) String() string {
	return strings.TrimSpace(fmt.Sprintf("%s %s", a.IPNet, a.Label))
}
1330235
func (s *StateCodeExpr) String() string {
	return fmt.Sprintf("%s: %T{Code: %v}", s.p, s, s.Code)
}
166358
func (s *StringValue) String() string {
	var current string
	if s.v != nil {
		current = *(s.v)
	}
	return current
}
790084
func (og *OpenGraph) String() string {
	data, err := og.ToJSON()

	if err != nil {
		return err.Error()
	}

	return string(data[:])
}
1190004
func (node *PathExpression) String() string {
	return fmt.Sprintf("Path{Original:'%s', Pos:%d}", node.Original, node.Loc.Pos)
}
434802
func (exp *UnaryExpr) String() string {
	return fmt.Sprintf("UnaryExpr(%s %s)", exp.Op, exp.X)
}
311886
func (v MapType) String() string {
	x := (map[string]*Bonk)(v)
	return fmt.Sprint(x)
}
732763
func (o *Object) String() string {
	raw, err := json.MarshalIndent(o, "", " ")
	if err != nil {
		return err.Error()
	}

	return string(raw)
}