diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-15 10:49:58 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-15 10:49:58 +0800 |
commit | 843ef4abc659b3816e2a9f20622fef1a75240ecf (patch) | |
tree | f804abf08d8a6cbee4dc9fed43d7508127af03a6 /src/hir/deserialise.cpp | |
parent | f6c60250561ab65f15a8453fe5b137cee6ad92a5 (diff) | |
download | mrust-843ef4abc659b3816e2a9f20622fef1a75240ecf.tar.gz |
HIR - Rough support for associated consts
Diffstat (limited to 'src/hir/deserialise.cpp')
-rw-r--r-- | src/hir/deserialise.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/hir/deserialise.cpp b/src/hir/deserialise.cpp index f9ad4460..75efdccf 100644 --- a/src/hir/deserialise.cpp +++ b/src/hir/deserialise.cpp @@ -228,6 +228,14 @@ namespace { read_bool(), read_bool(), deserialise_function() } ) ); } + size_t const_count = read_count(); + for(size_t i = 0; i < const_count; i ++) + { + auto name = read_string(); + rv.m_constants.insert( ::std::make_pair( mv$(name), ::HIR::TypeImpl::VisImplEnt< ::HIR::Constant> { + read_bool(), read_bool(), deserialise_constant() + } ) ); + } // m_src_module doesn't matter after typeck return rv; } @@ -253,8 +261,8 @@ namespace { for(size_t i = 0; i < const_count; i ++) { auto name = read_string(); - rv.m_constants.insert( ::std::make_pair( mv$(name), ::HIR::TraitImpl::ImplEnt< ::HIR::ExprPtr> { - read_bool(), deserialise_exprptr() + rv.m_constants.insert( ::std::make_pair( mv$(name), ::HIR::TraitImpl::ImplEnt< ::HIR::Constant> { + read_bool(), deserialise_constant() } ) ); } size_t type_count = read_count(); @@ -914,6 +922,7 @@ namespace { switch( read_tag() ) { #define _(x, ...) case ::HIR::Literal::TAG_##x: return ::HIR::Literal::make_##x(__VA_ARGS__); + _(Invalid, {}) _(List, deserialise_vec< ::HIR::Literal>() ) _(Variant, { static_cast<unsigned int>(read_count()), |