diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-27 17:14:39 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-27 17:14:39 +0800 |
commit | e91522341ea4c6922d25aaca3bce3138da95648d (patch) | |
tree | e875f3fefee5ffff2d02bf2ae29b4219b6452363 /src | |
parent | 4e06fd9069caa3cc12a754df4bff82e9d4148d98 (diff) | |
download | mrust-e91522341ea4c6922d25aaca3bce3138da95648d.tar.gz |
AST - Enable crate loading!
Diffstat (limited to 'src')
-rw-r--r-- | src/ast/crate.cpp | 7 | ||||
-rw-r--r-- | src/main.cpp | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/ast/crate.cpp b/src/ast/crate.cpp index d0fa8217..a663e300 100644 --- a/src/ast/crate.cpp +++ b/src/ast/crate.cpp @@ -4,9 +4,8 @@ #include "ast.hpp" #include "../parse/parseerror.hpp" #include "../expand/cfg.hpp" -#include <hir/hir.hpp> // HIR Crate - -#include <serialiser_texttree.hpp> +#include <hir/hir.hpp> // HIR::Crate +#include <hir/main_bindings.hpp> // HIR_Deserialise namespace { bool check_item_cfg(const ::AST::MetaItems& attrs) @@ -65,7 +64,7 @@ void Crate::load_extern_crate(const ::std::string& name) ExternCrate::ExternCrate(const ::std::string& path) { - throw ParseError::Todo( FMT("Load extern crate from a file - '" << path << "'") ); + m_hir = HIR_Deserialise(path); } const MacroRules* ExternCrate::find_macro_rules(const ::std::string& name) diff --git a/src/main.cpp b/src/main.cpp index e30040db..71da37c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -299,7 +299,8 @@ int main(int argc, char *argv[]) case ::AST::Crate::Type::RustLib:
// Save a loadable HIR dump
CompilePhaseV("HIR Serialise", [&]() {
- HIR_Serialise(params.outfile + ".meta", *hir_crate);
+ //HIR_Serialise(params.outfile + ".meta", *hir_crate);
+ HIR_Serialise(params.outfile, *hir_crate);
});
// Generate a .o
//HIR_Codegen(params.outfile + ".o", *hir_crate);
|