@@ -33,7 +33,7 @@ def __init__(self, file, compiler_arguments):
3333 }
3434
3535 @staticmethod
36- def is_valid_child (parent_node , child_node ):
36+ def _is_valid_child (parent_node , child_node ):
3737 child = child_node .get ("cursor" )
3838 parent_filename = parent_node .get ("filename" )
3939
@@ -117,7 +117,7 @@ def parse_node_recursive(cls, node):
117117 # Get cursor's children and recursively add their info to a dictionary, as members of the parent
118118 for child in cursor .get_children ():
119119 child_node = {"cursor" : child , "filename" : filename , "depth" : depth + 1 }
120- if cls .is_valid_child (node , child_node ):
120+ if cls ._is_valid_child (node , child_node ):
121121 child_parsed_info = cls .parse_node_recursive (child_node )
122122 parsed_info ["members" ].append (child_parsed_info )
123123
@@ -133,30 +133,3 @@ def get_parsed_info(self):
133133 - The key 'members' contains the node's children's `parsed_info`
134134 """
135135 return self .parse_node_recursive (self .root_node )
136-
137- # @TODO: Move the function out of this file in a separate PR
138- @staticmethod
139- def get_compilation_arguments (compilation_database_path , filename ):
140- """
141- Yields the compilation commands extracted from the compilation database
142-
143- Parameters:
144- - compilation_database_path: The path to `compile_commands.json`
145- - filename: The file's name to get its compilation commands
146-
147- Yields:
148- - compilation commands (list): The arguments passed to the compiler
149- """
150-
151- # Build a compilation database found in the given directory
152- compilation_database = clang .CompilationDatabase .fromDirectory (
153- buildDir = compilation_database_path
154- )
155- # Get compilation commands from the compilation database for the given file
156- compilation_commands = compilation_database .getCompileCommands (
157- filename = filename
158- )
159-
160- for compilation_command in compilation_commands :
161- # Extract compiler arguments, excluding compiler and filename
162- yield list (compilation_command .arguments )[1 :- 1 ]
0 commit comments