trace_calls: trace each call with a srcref attribute
Description
This function calls itself recursively so it can properly traverse the AST.
Usage
trace_calls(x, parent_functions = NULL, parent_ref = NULL)
Arguments
parent_functions
the functions which this call is a child of.
parent_ref
argument used to set the srcref of the current call when recursing
Value
a modified expression with count calls inserted before each previous
call.