From d2f604f09befa888dd9a8915189c8928053ae908 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 27 Aug 2016 21:09:47 +0800 Subject: Expand - Import macros from std/core --- src/expand/mod.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp index 5fd91c48..b57c852c 100644 --- a/src/expand/mod.cpp +++ b/src/expand/mod.cpp @@ -854,11 +854,17 @@ void Expand(::AST::Crate& crate) if( crate.m_prelude_path != AST::Path() ) crate.m_prelude_path = AST::Path("std", {AST::PathNode("prelude"), AST::PathNode("v1")}); crate.load_extern_crate("std"); + crate.m_extern_crates.at("std").with_all_macros([&](const auto& name, const auto& mac) { + crate.m_root_module.add_macro_import( name, mac ); + }); break; case ::AST::Crate::LOAD_CORE: if( crate.m_prelude_path != AST::Path() ) crate.m_prelude_path = AST::Path("core", {AST::PathNode("prelude")}); crate.load_extern_crate("core"); + crate.m_extern_crates.at("core").with_all_macros([&](const auto& name, const auto& mac) { + crate.m_root_module.add_macro_import( name, mac ); + }); break; case ::AST::Crate::LOAD_NONE: break; -- cgit v1.2.3