You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Adds a doxygen input filter (`input_filters/doxygen_strip_comments.py`) that strips block comments from source files before doxygen parses them.
This prevents doxygen from incorrectly parsing Objective-C code examples (like `interface`, `protocol`) within documentation comments as actual code declarations. For example, a doc comment containing:
```
/**
* Example:
* interface RCT_EXTERN_MODULE(MyModule, NSObject)
* end
*/
```
Was being parsed by doxygen as an actual interface declaration, resulting in malformed output like `interface RCT_EXTERN_MODULE {}` in the API snapshot.
## Changes
1. **Input Filter**: Added `doxygen_strip_comments.py` that replaces block comments with equivalent newlines to preserve line numbers.
2. **Fixed Empty Snapshots**: Fixed the `__main__.py` to properly pass the `${DOXYGEN_INPUT_FILTER}` placeholder value to doxygen config, which was causing empty snapshot generation.
3. **Normalized Pointer Spacing**: Added `normalize_pointer_spacing()` function to normalize doxygen's output:
- `NSString *` → `NSString*`
- `int &` → `int&`
- `T &&` → `T&&`
4. **Added Snapshot Test**: Created `should_not_parse_interface_from_doc_comment` test case demonstrating the issue.
Differential Revision: D94538938
0 commit comments