that string token should be an atom

types
Jordan Orelli 8 years ago
parent 66fe4d7290
commit 357c43fd54

@ -26,6 +26,9 @@ var atom_types = map[string]typeFn{
"int32": func(r bit.Reader) (value, error) { "int32": func(r bit.Reader) (value, error) {
return bit.ReadZigZag32(r), r.Err() return bit.ReadZigZag32(r), r.Err()
}, },
"CUtlStringToken": func(r bit.Reader) (value, error) {
return bit.ReadVarInt(r), r.Err()
},
} }
func atomType(spec *typeSpec, env *Env) tÿpe { func atomType(spec *typeSpec, env *Env) tÿpe {

@ -1,14 +0,0 @@
package ent
import (
"github.com/jordanorelli/hyperstone/bit"
)
func stringType(spec *typeSpec, env *Env) tÿpe {
if spec.typeName != "CUtlStringToken" {
return nil
}
return typeFn(func(r bit.Reader) (value, error) {
return bit.ReadVarInt(r), r.Err()
})
}

@ -32,7 +32,7 @@ func parseTypeSpec(spec *typeSpec, env *Env) tÿpe {
} }
return nil return nil
} }
return coalesce(atomType, floatType, handleType, qAngleType, hSeqType, genericType, stringType) return coalesce(atomType, floatType, handleType, qAngleType, hSeqType, genericType)
} }
// a type error is both an error and a type. It represents a type that we were // a type error is both an error and a type. It represents a type that we were

Loading…
Cancel
Save