TUN-528: Move cloudflared into a separate repo

This commit is contained in:
Areg Harutyunyan
2018-05-01 18:45:06 -05:00
parent e8c621a648
commit d06fc520c7
4726 changed files with 1763680 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["marshal.go"],
importpath = "zombiezen.com/go/capnproto2/encoding/text",
visibility = ["//visibility:public"],
deps = [
"//:go_default_library",
"//internal/nodemap:go_default_library",
"//internal/schema:go_default_library",
"//internal/strquote:go_default_library",
"//schemas:go_default_library",
],
)
go_test(
name = "go_default_test",
srcs = ["marshal_test.go"],
data = glob(["testdata/**"]),
embed = [":go_default_library"],
deps = [
"//:go_default_library",
"//internal/schema:go_default_library",
"//schemas:go_default_library",
],
)

View File

@@ -0,0 +1,455 @@
// Package text supports marshaling Cap'n Proto messages as text based on a schema.
package text
import (
"bytes"
"fmt"
"io"
"math"
"strconv"
"zombiezen.com/go/capnproto2"
"zombiezen.com/go/capnproto2/internal/nodemap"
"zombiezen.com/go/capnproto2/internal/schema"
"zombiezen.com/go/capnproto2/internal/strquote"
"zombiezen.com/go/capnproto2/schemas"
)
// Marker strings.
const (
voidMarker = "void"
interfaceMarker = "<external capability>"
anyPointerMarker = "<opaque pointer>"
)
// Marshal returns the text representation of a struct.
func Marshal(typeID uint64, s capnp.Struct) (string, error) {
buf := new(bytes.Buffer)
if err := NewEncoder(buf).Encode(typeID, s); err != nil {
return "", err
}
return buf.String(), nil
}
// MarshalList returns the text representation of a struct list.
func MarshalList(typeID uint64, l capnp.List) (string, error) {
buf := new(bytes.Buffer)
if err := NewEncoder(buf).EncodeList(typeID, l); err != nil {
return "", err
}
return buf.String(), nil
}
// An Encoder writes the text format of Cap'n Proto messages to an output stream.
type Encoder struct {
w errWriter
tmp []byte
nodes nodemap.Map
}
// NewEncoder returns a new encoder that writes to w.
func NewEncoder(w io.Writer) *Encoder {
return &Encoder{w: errWriter{w: w}}
}
// UseRegistry changes the registry that the encoder consults for
// schemas from the default registry.
func (enc *Encoder) UseRegistry(reg *schemas.Registry) {
enc.nodes.UseRegistry(reg)
}
// Encode writes the text representation of s to the stream.
func (enc *Encoder) Encode(typeID uint64, s capnp.Struct) error {
if enc.w.err != nil {
return enc.w.err
}
err := enc.marshalStruct(typeID, s)
if err != nil {
return err
}
return enc.w.err
}
// EncodeList writes the text representation of struct list l to the stream.
func (enc *Encoder) EncodeList(typeID uint64, l capnp.List) error {
_, seg, _ := capnp.NewMessage(capnp.SingleSegment(nil))
typ, _ := schema.NewRootType(seg)
typ.SetStructType()
typ.StructType().SetTypeId(typeID)
return enc.marshalList(typ, l)
}
func (enc *Encoder) marshalBool(v bool) {
if v {
enc.w.WriteString("true")
} else {
enc.w.WriteString("false")
}
}
func (enc *Encoder) marshalInt(i int64) {
enc.tmp = strconv.AppendInt(enc.tmp[:0], i, 10)
enc.w.Write(enc.tmp)
}
func (enc *Encoder) marshalUint(i uint64) {
enc.tmp = strconv.AppendUint(enc.tmp[:0], i, 10)
enc.w.Write(enc.tmp)
}
func (enc *Encoder) marshalFloat32(f float32) {
enc.tmp = strconv.AppendFloat(enc.tmp[:0], float64(f), 'g', -1, 32)
enc.w.Write(enc.tmp)
}
func (enc *Encoder) marshalFloat64(f float64) {
enc.tmp = strconv.AppendFloat(enc.tmp[:0], f, 'g', -1, 64)
enc.w.Write(enc.tmp)
}
func (enc *Encoder) marshalText(t []byte) {
enc.tmp = strquote.Append(enc.tmp[:0], t)
enc.w.Write(enc.tmp)
}
func needsEscape(b byte) bool {
return b < 0x20 || b >= 0x7f
}
func hexDigit(b byte) byte {
const digits = "0123456789abcdef"
return digits[b]
}
func (enc *Encoder) marshalStruct(typeID uint64, s capnp.Struct) error {
n, err := enc.nodes.Find(typeID)
if err != nil {
return err
}
if !n.IsValid() || n.Which() != schema.Node_Which_structNode {
return fmt.Errorf("cannot find struct type %#x", typeID)
}
var discriminant uint16
if n.StructNode().DiscriminantCount() > 0 {
discriminant = s.Uint16(capnp.DataOffset(n.StructNode().DiscriminantOffset() * 2))
}
enc.w.WriteByte('(')
fields := codeOrderFields(n.StructNode())
first := true
for _, f := range fields {
if !(f.Which() == schema.Field_Which_slot || f.Which() == schema.Field_Which_group) {
continue
}
if dv := f.DiscriminantValue(); !(dv == schema.Field_noDiscriminant || dv == discriminant) {
continue
}
if !first {
enc.w.WriteString(", ")
}
first = false
name, err := f.NameBytes()
if err != nil {
return err
}
enc.w.Write(name)
enc.w.WriteString(" = ")
switch f.Which() {
case schema.Field_Which_slot:
if err := enc.marshalFieldValue(s, f); err != nil {
return err
}
case schema.Field_Which_group:
if err := enc.marshalStruct(f.Group().TypeId(), s); err != nil {
return err
}
}
}
enc.w.WriteByte(')')
return nil
}
func (enc *Encoder) marshalFieldValue(s capnp.Struct, f schema.Field) error {
typ, err := f.Slot().Type()
if err != nil {
return err
}
dv, err := f.Slot().DefaultValue()
if err != nil {
return err
}
if dv.IsValid() && int(typ.Which()) != int(dv.Which()) {
name, _ := f.Name()
return fmt.Errorf("marshal field %s: default value is a %v, want %v", name, dv.Which(), typ.Which())
}
switch typ.Which() {
case schema.Type_Which_void:
enc.w.WriteString(voidMarker)
case schema.Type_Which_bool:
v := s.Bit(capnp.BitOffset(f.Slot().Offset()))
d := dv.Bool()
enc.marshalBool(!d && v || d && !v)
case schema.Type_Which_int8:
v := s.Uint8(capnp.DataOffset(f.Slot().Offset()))
d := uint8(dv.Int8())
enc.marshalInt(int64(int8(v ^ d)))
case schema.Type_Which_int16:
v := s.Uint16(capnp.DataOffset(f.Slot().Offset() * 2))
d := uint16(dv.Int16())
enc.marshalInt(int64(int16(v ^ d)))
case schema.Type_Which_int32:
v := s.Uint32(capnp.DataOffset(f.Slot().Offset() * 4))
d := uint32(dv.Int32())
enc.marshalInt(int64(int32(v ^ d)))
case schema.Type_Which_int64:
v := s.Uint64(capnp.DataOffset(f.Slot().Offset() * 8))
d := uint64(dv.Int64())
enc.marshalInt(int64(v ^ d))
case schema.Type_Which_uint8:
v := s.Uint8(capnp.DataOffset(f.Slot().Offset()))
d := dv.Uint8()
enc.marshalUint(uint64(v ^ d))
case schema.Type_Which_uint16:
v := s.Uint16(capnp.DataOffset(f.Slot().Offset() * 2))
d := dv.Uint16()
enc.marshalUint(uint64(v ^ d))
case schema.Type_Which_uint32:
v := s.Uint32(capnp.DataOffset(f.Slot().Offset() * 4))
d := dv.Uint32()
enc.marshalUint(uint64(v ^ d))
case schema.Type_Which_uint64:
v := s.Uint64(capnp.DataOffset(f.Slot().Offset() * 8))
d := dv.Uint64()
enc.marshalUint(v ^ d)
case schema.Type_Which_float32:
v := s.Uint32(capnp.DataOffset(f.Slot().Offset() * 4))
d := math.Float32bits(dv.Float32())
enc.marshalFloat32(math.Float32frombits(v ^ d))
case schema.Type_Which_float64:
v := s.Uint64(capnp.DataOffset(f.Slot().Offset() * 8))
d := math.Float64bits(dv.Float64())
enc.marshalFloat64(math.Float64frombits(v ^ d))
case schema.Type_Which_structType:
p, err := s.Ptr(uint16(f.Slot().Offset()))
if err != nil {
return err
}
if !p.IsValid() {
p, _ = dv.StructValuePtr()
}
return enc.marshalStruct(typ.StructType().TypeId(), p.Struct())
case schema.Type_Which_data:
p, err := s.Ptr(uint16(f.Slot().Offset()))
if err != nil {
return err
}
if !p.IsValid() {
b, _ := dv.Data()
enc.marshalText(b)
return nil
}
enc.marshalText(p.Data())
case schema.Type_Which_text:
p, err := s.Ptr(uint16(f.Slot().Offset()))
if err != nil {
return err
}
if !p.IsValid() {
b, _ := dv.TextBytes()
enc.marshalText(b)
return nil
}
enc.marshalText(p.TextBytes())
case schema.Type_Which_list:
elem, err := typ.List().ElementType()
if err != nil {
return err
}
p, err := s.Ptr(uint16(f.Slot().Offset()))
if err != nil {
return err
}
if !p.IsValid() {
p, _ = dv.ListPtr()
}
return enc.marshalList(elem, p.List())
case schema.Type_Which_enum:
v := s.Uint16(capnp.DataOffset(f.Slot().Offset() * 2))
d := dv.Uint16()
return enc.marshalEnum(typ.Enum().TypeId(), v^d)
case schema.Type_Which_interface:
enc.w.WriteString(interfaceMarker)
case schema.Type_Which_anyPointer:
enc.w.WriteString(anyPointerMarker)
default:
return fmt.Errorf("unknown field type %v", typ.Which())
}
return nil
}
func codeOrderFields(s schema.Node_structNode) []schema.Field {
list, _ := s.Fields()
n := list.Len()
fields := make([]schema.Field, n)
for i := 0; i < n; i++ {
f := list.At(i)
fields[f.CodeOrder()] = f
}
return fields
}
func (enc *Encoder) marshalList(elem schema.Type, l capnp.List) error {
switch elem.Which() {
case schema.Type_Which_void:
enc.w.WriteString(capnp.VoidList{List: l}.String())
case schema.Type_Which_bool:
enc.w.WriteString(capnp.BitList{List: l}.String())
case schema.Type_Which_int8:
enc.w.WriteString(capnp.Int8List{List: l}.String())
case schema.Type_Which_int16:
enc.w.WriteString(capnp.Int16List{List: l}.String())
case schema.Type_Which_int32:
enc.w.WriteString(capnp.Int32List{List: l}.String())
case schema.Type_Which_int64:
enc.w.WriteString(capnp.Int64List{List: l}.String())
case schema.Type_Which_uint8:
enc.w.WriteString(capnp.UInt8List{List: l}.String())
case schema.Type_Which_uint16:
enc.w.WriteString(capnp.UInt16List{List: l}.String())
case schema.Type_Which_uint32:
enc.w.WriteString(capnp.UInt32List{List: l}.String())
case schema.Type_Which_uint64:
enc.w.WriteString(capnp.UInt64List{List: l}.String())
case schema.Type_Which_float32:
enc.w.WriteString(capnp.Float32List{List: l}.String())
case schema.Type_Which_float64:
enc.w.WriteString(capnp.Float64List{List: l}.String())
case schema.Type_Which_data:
enc.w.WriteString(capnp.DataList{List: l}.String())
case schema.Type_Which_text:
enc.w.WriteString(capnp.TextList{List: l}.String())
case schema.Type_Which_structType:
enc.w.WriteByte('[')
for i := 0; i < l.Len(); i++ {
if i > 0 {
enc.w.WriteString(", ")
}
err := enc.marshalStruct(elem.StructType().TypeId(), l.Struct(i))
if err != nil {
return err
}
}
enc.w.WriteByte(']')
case schema.Type_Which_list:
enc.w.WriteByte('[')
ee, err := elem.List().ElementType()
if err != nil {
return err
}
for i := 0; i < l.Len(); i++ {
if i > 0 {
enc.w.WriteString(", ")
}
p, err := capnp.PointerList{List: l}.PtrAt(i)
if err != nil {
return err
}
err = enc.marshalList(ee, p.List())
if err != nil {
return err
}
}
enc.w.WriteByte(']')
case schema.Type_Which_enum:
enc.w.WriteByte('[')
il := capnp.UInt16List{List: l}
typ := elem.Enum().TypeId()
// TODO(light): only search for node once
for i := 0; i < il.Len(); i++ {
if i > 0 {
enc.w.WriteString(", ")
}
enc.marshalEnum(typ, il.At(i))
}
enc.w.WriteByte(']')
case schema.Type_Which_interface:
enc.w.WriteByte('[')
for i := 0; i < l.Len(); i++ {
if i > 0 {
enc.w.WriteString(", ")
}
enc.w.WriteString(interfaceMarker)
}
enc.w.WriteByte(']')
case schema.Type_Which_anyPointer:
enc.w.WriteByte('[')
for i := 0; i < l.Len(); i++ {
if i > 0 {
enc.w.WriteString(", ")
}
enc.w.WriteString(anyPointerMarker)
}
enc.w.WriteByte(']')
default:
return fmt.Errorf("unknown list type %v", elem.Which())
}
return nil
}
func (enc *Encoder) marshalEnum(typ uint64, val uint16) error {
n, err := enc.nodes.Find(typ)
if err != nil {
return err
}
if n.Which() != schema.Node_Which_enum {
return fmt.Errorf("marshaling enum of type @%#x: type is not an enum", typ)
}
enums, err := n.Enum().Enumerants()
if err != nil {
return err
}
if int(val) >= enums.Len() {
enc.marshalUint(uint64(val))
return nil
}
name, err := enums.At(int(val)).NameBytes()
if err != nil {
return err
}
enc.w.Write(name)
return nil
}
type errWriter struct {
w io.Writer
err error
}
func (ew *errWriter) Write(p []byte) (int, error) {
if ew.err != nil {
return 0, ew.err
}
var n int
n, ew.err = ew.w.Write(p)
return n, ew.err
}
func (ew *errWriter) WriteString(s string) (int, error) {
if ew.err != nil {
return 0, ew.err
}
var n int
n, ew.err = io.WriteString(ew.w, s)
return n, ew.err
}
func (ew *errWriter) WriteByte(b byte) error {
if ew.err != nil {
return ew.err
}
if bw, ok := ew.w.(io.ByteWriter); ok {
ew.err = bw.WriteByte(b)
} else {
_, ew.err = ew.w.Write([]byte{b})
}
return ew.err
}

View File

@@ -0,0 +1,229 @@
package text
import (
"bytes"
"io/ioutil"
"path/filepath"
"testing"
"zombiezen.com/go/capnproto2"
"zombiezen.com/go/capnproto2/internal/schema"
"zombiezen.com/go/capnproto2/schemas"
)
func readTestFile(name string) ([]byte, error) {
path := filepath.Join("testdata", name)
return ioutil.ReadFile(path)
}
func TestEncode(t *testing.T) {
tests := []struct {
constID uint64
text string
}{
{0xc0b634e19e5a9a4e, `(key = "42", value = (int32 = -123))`},
{0x967c8fe21790b0fb, `(key = "float", value = (float64 = 3.14))`},
{0xdf35cb2e1f5ea087, `(key = "bool", value = (bool = false))`},
{0xb167974479102805, `(map = [(key = "foo", value = (void = void)), (key = "bar", value = (void = void))])`},
{0x81fdbfdc91779421, `(map = [])`},
{0x8e85252144f61858, `(data = "Hi\xde\xad\xbe\xef\xca\xfe")`},
{0xc21398a8474837ba, `(voidList = [void, void])`},
{0xde82c2eeb3a4b07c, `(boolList = [true, false, true, false])`},
{0xf9e3ffc179272aa2, `(int8List = [1, -2, 3])`},
{0xfc421b96ec6ad2b6, `(int64List = [1, -2, 3])`},
{0xb3034b89d02775a5, `(uint8List = [255, 0, 1])`},
{0x9246c307e46ad03b, `(uint64List = [1, 2, 3])`},
{0xd012128a1a9cb7fc, `(float32List = [0.5, 3.14, -2])`},
{0xf16c386c66d492e2, `(textList = ["foo", "bar", "baz"])`},
{0xe14f4d42aa55de8c, `(dataList = ["\xde\xad\xbe\xef", "\xca\xfe"])`},
{0xe88c91698f7f0b73, `(cheese = gouda)`},
{0x9c51b843b337490b, `(cheeseList = [gouda, cheddar])`},
{0x81e2aadb8bfb237b, `(matrix = [[1, 2, 3], [4, 5, 6]])`},
}
data, err := readTestFile("txt.capnp.out")
if err != nil {
t.Fatal(err)
}
reg := new(schemas.Registry)
err = reg.Register(&schemas.Schema{
Bytes: data,
Nodes: []uint64{
0x8df8bc5abdc060a6,
0xd3602730c572a43b,
},
})
if err != nil {
t.Fatalf("Adding to registry: %v", err)
}
msg, err := capnp.Unmarshal(data)
if err != nil {
t.Fatal("Unmarshaling txt.capnp.out:", err)
}
req, err := schema.ReadRootCodeGeneratorRequest(msg)
if err != nil {
t.Fatal("Reading code generator request txt.capnp.out:", err)
}
nodes, err := req.Nodes()
if err != nil {
t.Fatal(err)
}
nodeMap := make(map[uint64]schema.Node, nodes.Len())
for i := 0; i < nodes.Len(); i++ {
n := nodes.At(i)
nodeMap[n.Id()] = n
}
for _, test := range tests {
c := nodeMap[test.constID]
if !c.IsValid() {
t.Errorf("Can't find node %#x; skipping", test.constID)
continue
}
dn, _ := c.DisplayName()
if c.Which() != schema.Node_Which_const {
t.Errorf("%s @%#x is a %v, not const; skipping", dn, test.constID, c.Which())
continue
}
typ, err := c.Const().Type()
if err != nil {
t.Errorf("(%s @%#x).const.type: %v", dn, test.constID, err)
continue
}
if typ.Which() != schema.Type_Which_structType {
t.Errorf("(%s @%#x).const.type is a %v; want struct", dn, test.constID, typ.Which())
continue
}
tid := typ.StructType().TypeId()
v, err := c.Const().Value()
if err != nil {
t.Errorf("(%s @%#x).const.value: %v", dn, test.constID, err)
continue
}
if v.Which() != schema.Value_Which_structValue {
t.Errorf("(%s @%#x).const.value is a %v; want struct", dn, test.constID, v.Which())
continue
}
sv, err := v.StructValuePtr()
if err != nil {
t.Errorf("(%s @%#x).const.value.struct: %v", dn, test.constID, err)
continue
}
buf := new(bytes.Buffer)
enc := NewEncoder(buf)
enc.UseRegistry(reg)
if err := enc.Encode(tid, sv.Struct()); err != nil {
t.Errorf("Encode(%#x, (%s @%#x).const.value.struct): %v", tid, dn, test.constID, err)
continue
}
if text := buf.String(); text != test.text {
t.Errorf("Encode(%#x, (%s @%#x).const.value.struct) = %q; want %q", tid, dn, test.constID, text, test.text)
continue
}
}
}
func TestEncodeList(t *testing.T) {
tests := []struct {
constID uint64
text string
}{
{0x90c9e81e6418df8e, `[(key = "foo", value = (void = void)), (key = "bar", value = (void = void))]`},
}
data, err := readTestFile("txt.capnp.out")
if err != nil {
t.Fatal(err)
}
reg := new(schemas.Registry)
err = reg.Register(&schemas.Schema{
Bytes: data,
Nodes: []uint64{
0x8df8bc5abdc060a6,
0xd3602730c572a43b,
},
})
if err != nil {
t.Fatalf("Adding to registry: %v", err)
}
msg, err := capnp.Unmarshal(data)
if err != nil {
t.Fatal("Unmarshaling txt.capnp.out:", err)
}
req, err := schema.ReadRootCodeGeneratorRequest(msg)
if err != nil {
t.Fatal("Reading code generator request txt.capnp.out:", err)
}
nodes, err := req.Nodes()
if err != nil {
t.Fatal(err)
}
nodeMap := make(map[uint64]schema.Node, nodes.Len())
for i := 0; i < nodes.Len(); i++ {
n := nodes.At(i)
nodeMap[n.Id()] = n
}
for _, test := range tests {
c := nodeMap[test.constID]
if !c.IsValid() {
t.Errorf("Can't find node %#x; skipping", test.constID)
continue
}
dn, _ := c.DisplayName()
if c.Which() != schema.Node_Which_const {
t.Errorf("%s @%#x is a %v, not const; skipping", dn, test.constID, c.Which())
continue
}
typ, err := c.Const().Type()
if err != nil {
t.Errorf("(%s @%#x).const.type: %v", dn, test.constID, err)
continue
}
if typ.Which() != schema.Type_Which_list {
t.Errorf("(%s @%#x).const.type is a %v; want list", dn, test.constID, typ.Which())
continue
}
etyp, err := typ.List().ElementType()
if err != nil {
t.Errorf("(%s @%#x).const.type.list.element_type: %v", dn, test.constID, err)
continue
}
if etyp.Which() != schema.Type_Which_structType {
t.Errorf("(%s @%#x).const.type is a %v; want struct", dn, test.constID, etyp.Which())
continue
}
tid := etyp.StructType().TypeId()
v, err := c.Const().Value()
if err != nil {
t.Errorf("(%s @%#x).const.value: %v", dn, test.constID, err)
continue
}
if v.Which() != schema.Value_Which_list {
t.Errorf("(%s @%#x).const.value is a %v; want list", dn, test.constID, v.Which())
continue
}
lv, err := v.ListPtr()
if err != nil {
t.Errorf("(%s @%#x).const.value.list: %v", dn, test.constID, err)
continue
}
buf := new(bytes.Buffer)
enc := NewEncoder(buf)
enc.UseRegistry(reg)
if err := enc.EncodeList(tid, lv.List()); err != nil {
t.Errorf("Encode(%#x, (%s @%#x).const.value.list): %v", tid, dn, test.constID, err)
continue
}
if text := buf.String(); text != test.text {
t.Errorf("Encode(%#x, (%s @%#x).const.value.list) = %q; want %q", tid, dn, test.constID, text, test.text)
continue
}
}
}

View File

@@ -0,0 +1,76 @@
@0x8ae03d633330d781;
struct KeyValue @0x8df8bc5abdc060a6 {
key @0 :Text;
value @1 :Value;
}
struct Value @0xd3602730c572a43b {
union {
void @0 :Void;
bool @1 :Bool;
int8 @2 :Int8;
int16 @3 :Int16;
int32 @4 :Int32;
int64 @5 :Int64;
uint8 @6 :UInt8;
uint16 @7 :UInt16;
uint32 @8 :UInt32;
uint64 @9 :UInt64;
float32 @10 :Float32;
float64 @11 :Float64;
text @12 :Text;
data @13 :Data;
cheese @29 :Cheese;
map @14 :List(KeyValue);
voidList @15 :List(Void);
boolList @16 :List(Bool);
int8List @17 :List(Int8);
int16List @18 :List(Int16);
int32List @19 :List(Int32);
int64List @20 :List(Int64);
uint8List @21 :List(UInt8);
uint16List @22 :List(UInt16);
uint32List @23 :List(UInt32);
uint64List @24 :List(UInt64);
float32List @25 :List(Float32);
float64List @26 :List(Float64);
textList @27 :List(Text);
dataList @28 :List(Data);
cheeseList @30 :List(Cheese);
matrix @31 :List(List(Int32));
}
}
enum Cheese {
cheddar @0;
gouda @1;
}
const kv @0xc0b634e19e5a9a4e :KeyValue = (key = "42", value = (int32 = -123));
const floatKv @0x967c8fe21790b0fb :KeyValue = (key = "float", value = (float64 = 3.14));
const boolKv @0xdf35cb2e1f5ea087 :KeyValue = (key = "bool", value = (bool = false));
const mapVal @0xb167974479102805 :Value = (map = [
(key = "foo", value = (void = void)),
(key = "bar", value = (void = void)),
]);
const data @0x8e85252144f61858 :Value = (data = 0x"4869 dead beef cafe");
const emptyMap @0x81fdbfdc91779421 :Value = (map = []);
const voidList @0xc21398a8474837ba :Value = (voidList = [void, void]);
const boolList @0xde82c2eeb3a4b07c :Value = (boolList = [true, false, true, false]);
const int8List @0xf9e3ffc179272aa2 :Value = (int8List = [1, -2, 3]);
const int64List @0xfc421b96ec6ad2b6 :Value = (int64List = [1, -2, 3]);
const uint8List @0xb3034b89d02775a5 :Value = (uint8List = [255, 0, 1]);
const uint64List @0x9246c307e46ad03b :Value = (uint64List = [1, 2, 3]);
const floatList @0xd012128a1a9cb7fc :Value = (float32List = [0.5, 3.14, -2.0]);
const textList @0xf16c386c66d492e2 :Value = (textList = ["foo", "bar", "baz"]);
const dataList @0xe14f4d42aa55de8c :Value = (dataList = [0x"deadbeef", 0x"cafe"]);
const cheese @0xe88c91698f7f0b73 :Value = (cheese = gouda);
const cheeseList @0x9c51b843b337490b :Value = (cheeseList = [gouda, cheddar]);
const matrix @0x81e2aadb8bfb237b :Value = (matrix = [[1, 2, 3], [4, 5, 6]]);
const kvList @0x90c9e81e6418df8e :List(KeyValue) = [
(key = "foo", value = (void = void)),
(key = "bar", value = (void = void)),
];

Binary file not shown.