summaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorJohn Hodge (sonata) <tpg@mutabah.net>2015-01-17 14:44:26 +0800
committerJohn Hodge (sonata) <tpg@mutabah.net>2015-01-17 14:44:26 +0800
commit0eaa7a5a300de625dfa813f49b04407c9f0a4feb (patch)
tree96a81ddeca3006469005591e4433ed9a6d0e9737 /src/types.cpp
parentf99a99e79ff7946dcf7a283c87caf8f0a92c2c03 (diff)
downloadmrust-0eaa7a5a300de625dfa813f49b04407c9f0a4feb.tar.gz
Trait serialise
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/types.cpp b/src/types.cpp
index b2dcd582..907bffc0 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -89,8 +89,21 @@ void operator% (::Deserialiser& d, eCoreType& ct) {
d.item(n);
/* */if(n == "-") ct = CORETYPE_INVAL;
else if(n == "_") ct = CORETYPE_ANY;
+ else if(n == "char") ct = CORETYPE_CHAR;
+ else if(n == "usize") ct = CORETYPE_UINT;
+ else if(n == "isize") ct = CORETYPE_INT;
+ else if(n == "u8") ct = CORETYPE_U8;
+ else if(n == "i8") ct = CORETYPE_I8;
+ else if(n == "u16") ct = CORETYPE_U16;
+ else if(n == "i16") ct = CORETYPE_I16;
+ else if(n == "u32") ct = CORETYPE_U32;
+ else if(n == "i32") ct = CORETYPE_I32;
+ else if(n == "u64") ct = CORETYPE_U64;
+ else if(n == "i64") ct = CORETYPE_I64;
+ else if(n == "f32") ct = CORETYPE_F32;
+ else if(n == "f64") ct = CORETYPE_F64;
else
- throw ::std::runtime_error("Deserialise failure - " + n);
+ throw ::std::runtime_error("Deserialise failure - coretype " + n);
}
const char* TypeRef::class_name(TypeRef::Class c) {
switch(c)