You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
476 B
Go

package ent
import (
"github.com/jordanorelli/hyperstone/bit"
)
var atom_types = map[string]typeFn{
"uint16": func(r bit.Reader) (value, error) {
// TODO: bounds check here
return uint16(bit.ReadVarInt(r)), r.Err()
},
"int32": func(r bit.Reader) (value, error) {
return int32(bit.ReadZigZag32(r)), r.Err()
},
}
func atomType(spec *typeSpec, env *Env) tÿpe {
if t, ok := atom_types[spec.typeName]; ok {
Debug.Printf(" atom type")
return t
}
return nil
}