parameters: (node, closure, in_function)
return_statement: return include_locations, closures
docstring: Macro invocations are not aligned with the remaining ast.
      - We need the macro invocation to get source line, where INSPECTOR was included
      - To get the position in the AST, we look for a our dummy header, this
        gives us the closure with all defined variables and symbols
      We can combine both information with a simple zip(a,b)
docstring_summary: Macro invocations are not aligned with the remaining ast.
      - We need the macro invocation to get source line, where INSPECTOR was included
      - To get the position in the AST, we look for a our dummy header, this
        gives us the closure with all defined variables and symbols
      We can combine both information with a simple zip(a,b)
docstring_tokens: Macro invocations are not aligned with the remaining ast . - We need the macro invocation to get source line where INSPECTOR was included - To get the position in the AST we look for a our dummy header this gives us the closure with all defined variables and symbols We can combine both information with a simple zip ( a b )
function: def _find_inspector_callsites(node, closure, in_function):
      """
      Macro invocations are not aligned with the remaining ast.
      - We need the macro invocation to get source line, where INSPECTOR was included
      - To get the position in the AST, we look for a our dummy header, this
        gives us the closure with all defined variables and symbols
      We can combine both information with a simple zip(a,b)
      """
      include_locations = []
      closures = []
      # reset closure outside of functions
      if not in_function:
          closure = []
      if node.kind == CursorKind.MACRO_INSTANTIATION and \
              node.spelling == "INSPECTOR":
          include_locations.append(node.location)
      elif in_function:
          if node.kind == CursorKind.COMPOUND_STMT and \
                  node.location is not None and \
                  node.location.file.name.endswith("inspector/dummy.h"):
              closures.append(closure)
          elif node.kind == CursorKind.VAR_DECL or node.kind == CursorKind.PARM_DECL:
              closure.append(node)
  
      for c in node.get_children():
          in_function = in_function or node.kind == CursorKind.FUNCTION_DECL
          include_locations_, closures_ = _find_inspector_callsites(
              c, closure, in_function)
          include_locations.extend(include_locations_)
          closures.extend(closures_)
  
      return include_locations, closures
function_tokens: def _find_inspector_callsites ( node , closure , in_function ) : include_locations = [ ] closures = [ ] # reset closure outside of functions if not in_function : closure = [ ] if node . kind == CursorKind . MACRO_INSTANTIATION and node . spelling == "INSPECTOR" : include_locations . append ( node . location ) elif in_function : if node . kind == CursorKind . COMPOUND_STMT and node . location is not None and node . location . file . name . endswith ( "inspector/dummy.h" ) : closures . append ( closure ) elif node . kind == CursorKind . VAR_DECL or node . kind == CursorKind . PARM_DECL : closure . append ( node ) for c in node . get_children ( ) : in_function = in_function or node . kind == CursorKind . FUNCTION_DECL include_locations_ , closures_ = _find_inspector_callsites ( c , closure , in_function ) include_locations . extend ( include_locations_ ) closures . extend ( closures_ ) return include_locations , closures