From 357c43fd5445fbafe291554e8da6e904d33dae3a Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Sat, 24 Sep 2016 22:38:09 -0400 Subject: [PATCH] that string token should be an atom --- ent/atoms.go | 3 +++ ent/string.go | 14 -------------- ent/type.go | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 ent/string.go diff --git a/ent/atoms.go b/ent/atoms.go index e4c38d6..9fa2d8f 100644 --- a/ent/atoms.go +++ b/ent/atoms.go @@ -26,6 +26,9 @@ var atom_types = map[string]typeFn{ "int32": func(r bit.Reader) (value, error) { 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 { diff --git a/ent/string.go b/ent/string.go deleted file mode 100644 index 63aca57..0000000 --- a/ent/string.go +++ /dev/null @@ -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() - }) -} diff --git a/ent/type.go b/ent/type.go index e78a6bc..62c6b23 100644 --- a/ent/type.go +++ b/ent/type.go @@ -32,7 +32,7 @@ func parseTypeSpec(spec *typeSpec, env *Env) tÿpe { } 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