value->accept_vis (*this);
auto final_fragment = expander.take_expanded_fragment ();
- auto proc_macro_fragment
- = expander.take_expanded_proc_macro_fragment ();
// FIXME: Is that correct? It seems *extremely* dodgy
if (final_fragment.should_expand ())
}
}
}
- else if (proc_macro_fragment.should_expand ())
- {
- it = values.erase (it);
- for (auto &node : proc_macro_fragment.get_nodes ())
- {
- auto new_node = extractor (node);
- if (new_node != nullptr)
- {
- it = values.insert (it, std::move (new_node));
- it++;
- }
- }
- }
else
{
++it;
: cfg (cfg), crate (crate), session (session),
sub_stack (SubstitutionScope ()),
expanded_fragment (AST::Fragment::create_error ()),
- expanded_proc_macro_fragment (AST::Fragment::create_error ()),
has_changed_flag (false), resolver (Resolver::Resolver::get ()),
mappings (Analysis::Mappings::get ())
{}
return fragment;
}
- void set_expanded_proc_macro_fragment (AST::Fragment &&fragment)
- {
- if (!fragment.is_error ())
- has_changed_flag = true;
-
- expanded_proc_macro_fragment = std::move (fragment);
- }
-
- AST::Fragment take_expanded_proc_macro_fragment ()
- {
- auto fragment = std::move (expanded_proc_macro_fragment);
- expanded_proc_macro_fragment = AST::Fragment::create_error ();
-
- return fragment;
- }
-
void import_proc_macros (std::string extern_crate);
template <typename T>
SubstitutionScope sub_stack;
std::vector<ContextType> context;
AST::Fragment expanded_fragment;
- AST::Fragment expanded_proc_macro_fragment;
bool has_changed_flag;
AST::MacroRulesDefinition *last_def;