Skip to main content

extract_function

Function extract_function 

Source
pub fn extract_function(
    ast: &File,
    function_index: usize,
) -> Option<(FunctionNode<'_>, Option<&str>)>
Expand description

Extract the nth top-level function from an AST file as a FunctionNode. Also returns the inferred name (e.g. from a variable declarator). Returns None if function_index is out of bounds.