faster deserilitation, super basic enums

This commit is contained in:
Nathan Braswell
2015-08-29 21:45:55 -04:00
parent b198cfb5b2
commit a84e2ee6e1
15 changed files with 134 additions and 60 deletions

View File

@@ -69,13 +69,12 @@ obj symbol (Object, Serializable) {
return serialize::serialize(data) + serialize::serialize(name) + serialize::serialize(terminal)
}
fun unserialize(it: ref vector::vector<char>, pos: int): int {
var tempData = string::string()
var tempName = string::string()
util::unpack(tempData, pos) = serialize::unserialize<string::string>(it, pos)
util::unpack(tempName, pos) = serialize::unserialize<string::string>(it, pos)
/*construct()*/
/*util::unpack(data, pos) = serialize::unserialize<string::string>(it, pos)*/
/*util::unpack(name, pos) = serialize::unserialize<string::string>(it, pos)*/
pos = data.unserialize(it, pos)
pos = name.unserialize(it, pos)
util::unpack(terminal, pos) = serialize::unserialize<bool>(it, pos)
data.copy_construct(&tempData)
name.copy_construct(&tempName)
return pos
}
fun operator==(other: ref symbol): bool {