diff options
Diffstat (limited to 'src/macro_processor')
| -rw-r--r-- | src/macro_processor/macro_processor.rs | 11 | 
1 files changed, 10 insertions, 1 deletions
diff --git a/src/macro_processor/macro_processor.rs b/src/macro_processor/macro_processor.rs index 93a86af..2e8675f 100644 --- a/src/macro_processor/macro_processor.rs +++ b/src/macro_processor/macro_processor.rs @@ -145,7 +145,7 @@ fn smp_builtin_include(  }  /// Include a new file verbatim, don't do ANY additional processing -fn smp_builtin_include_verbatim ( +fn smp_builtin_include_verbatim(      smp: &mut MacroProcessor,      macro_name: &str,      args: &mut [String], @@ -264,12 +264,15 @@ enum ParserState {  pub struct MacroProcessor {      /// All currently defined macros in this MacroProcessor      pub macros: HashMap<String, MacroType>, +    /// All macro invocations that has happened +    pub macro_invocations: Vec<(String, Vec<String>)>,  }  impl MacroProcessor {      pub fn new() -> Self {          let mut smp = Self {              macros: HashMap::new(), +            macro_invocations: Vec::new(),          };          smp.define_builtins();          smp @@ -373,6 +376,12 @@ impl MacroProcessor {              return Ok(out);          }; +        // Log macro invokation +        // The fact that we are here, does not ensure that the macro is actually expanded into +        // something useful, just that it exists, and was invoked +        self.macro_invocations +            .push((macro_name.to_string(), args.to_vec())); +          match macro_body {              MacroType::String(body) => {                  let mut expanded = body.clone();  | 
