def parse_bzl(self, bzl_file):
"""Extracts documentation for all public macros from the given .bzl file.
Args:
bzl_file: The .bzl file to extract macro documentation from.
"""
try:
tree = ast.parse(open(bzl_file).read(), bzl_file)
self._add_file_docs(tree)
for stmt in tree.body:
if isinstance(stmt, ast.FunctionDef) and not stmt.name.startswith("_"):
self._add_macro_doc(stmt)
except IOError as e:
# Ignore missing extension
print("Failed to parse {0}: {1}".format(bzl_file, e.strerror))
pass
评论列表
文章目录