/// Invoke macros in Code, will process multiple times until there are no macros left in code,
/// which means the macro would expand recursively, and the recursive limit is set to 32 on default.
Invoke macros in Code, will process multiple times until there are no macros left in code,
which means the macro would expand recursively, and the recursive limit is set to 32 on default.
Invoke macros in Code will process multiple times until there are no macros left in code which means the macro would expand recursively and the recursive limit is set to 32 on default .
pub fn process(&self, macros: &HashMap<String, Box<dyn Invoker>>) -> Result<Code, Error> {
        let (mut code, n) = process(self, macros)?;
        // if there are no macros left, which means all macros have been invoked, then done.
        if n == 0 {
            return Ok(code);
        }
        // depth represents recursion times in this program.
        let mut depth = 0;
        while depth <= 32 {
            let rs = process(&code, macros)?;
            if rs.1 == 0 {
                return Ok(rs.0);
            }
            code = rs.0;
            depth += 1;
        }
        Err("recursive macro invocation reach the limit 32.".into())
    }
pub fn process ( & self , macros : & HashMap < String , Box < dyn Invoker > > ) -> Result < Code , Error > { let ( mut code , n ) = process ( self , macros ) ? ; // if there are no macros left, which means all macros have been invoked, then done. if n == 0 { return Ok ( code ) ; } // depth represents recursion times in this program. let mut depth = 0 ; while depth <= 32 { let rs = process ( & code , macros ) ? ; if rs . 1 == 0 { return Ok ( rs . 0 ) ; } code = rs . 0 ; depth += 1 ; } Err ( " " . into ( ) ) }
Invoke macros in Code, will process multiple times until there are no macros left in code,
which means the macro would expand recursively, and the recursive limit is set to 32 on default.
Invoke macros in Code will process multiple times until there are no macros left in code which means the macro would expand recursively and the recursive limit is set to 32 on default .
&self
macros
&HashMap<String, Box<dyn Invoker>>