AST::Crate &parsed_crate
= mappings.insert_ast_crate (std::move (ast_crate), current_crate);
- for (auto attribute : cli_attributes)
- parsed_crate.inject_inner_attribute (attribute);
-
/* basic pipeline:
* - lex
* - parse
}
// injection pipeline stage
- injection (parsed_crate);
+ injection (parsed_crate, cli_attributes);
rust_debug ("\033[0;31mSUCCESSFULLY FINISHED INJECTION \033[0m");
if (options.dump_option_enabled (CompileOptions::INJECTION_DUMP))
{
}
void
-Session::injection (AST::Crate &crate)
+Session::injection (AST::Crate &crate, AST::AttrVec cli_attributes)
{
rust_debug ("started injection");
* macros, cfg, and test should be prioritised since they seem to be used
* the most. */
+ for (auto attribute : cli_attributes)
+ crate.inject_inner_attribute (attribute);
+
// crate injection
std::vector<std::string> names;
if (contains_name (crate.inner_attrs, "no_core"))
/* Injection pipeline stage. TODO maybe move to another object? Maybe have
* some lint checks (in future, obviously), register builtin macros, crate
* injection. */
- void injection (AST::Crate &crate);
+ void injection (AST::Crate &crate, AST::AttrVec cli_attributes);
/* Expansion pipeline stage. TODO maybe move to another object? Expands all
* macros, maybe build test harness in future, AST validation, maybe create