Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/cxx-api/parser/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ def main():
type=str,
help="Directory containing committed snapshots for comparison (used with --check)",
)
parser.add_argument(
"--view",
type=str,
help="Name of the API view to generate",
)
parser.add_argument(
"--test",
action="store_true",
Expand Down Expand Up @@ -250,6 +255,9 @@ def main():
def build_snapshots(output_dir: str, verbose: bool) -> None:
if not args.test:
for config in snapshot_configs:
if args.view and config.snapshot_name != args.view:
continue

build_snapshot_for_view(
api_view=config.snapshot_name,
react_native_dir=react_native_package_dir,
Expand Down
21 changes: 20 additions & 1 deletion scripts/cxx-api/parser/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def get_variable_member(
if initializer_type == InitializerType.BRACE:
is_brace_initializer = True

return VariableMember(
member = VariableMember(
variable_name,
variable_type,
visibility,
Expand All @@ -263,6 +263,10 @@ def get_variable_member(
is_brace_initializer,
)

member.add_template(get_template_params(member_def))

return member


def get_doxygen_params(
function_def: compound.MemberdefType,
Expand Down Expand Up @@ -313,6 +317,21 @@ def get_doxygen_params(
else:
param_type += param_array

# Handle pointer-to-member-function types where the name must be
# embedded inside the declarator group. Doxygen gives:
# type = "void(ns::*)() const", name = "asFoo"
# We need to produce:
# "void(ns::*asFoo)() const"
if param_name:
m = re.search(r"\([^)]*::\*\)", param_type)
if m:
# Insert name before the closing ')' of the ptr-to-member group
insert_pos = m.end() - 1
param_type = (
param_type[:insert_pos] + param_name + param_type[insert_pos:]
)
param_name = None

qualifiers, core_type = extract_qualifiers(param_type)
arguments.append((qualifiers, core_type, param_name, param_default))

Expand Down
Loading
Loading