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
6 changes: 6 additions & 0 deletions src/support/doxygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ static void process_paragragh(llvm::SmallVector<llvm::StringRef>::iterator& line
rest_of_line = trimed.drop_front(command_end);
}

if(command == "b" | command == "e" | command == "c") {
// Just start with inline command leave it.
goto normal_line;
}
Comment on lines +145 to +148
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use logical OR (||) instead of bitwise OR (|).

Line 145 uses bitwise OR | between bool operands. While this happens to produce the correct result for bool, it prevents short-circuit evaluation and is almost certainly a typo. Use || for logical disjunction.

Proposed fix
-        if(command == "b" | command == "e" | command == "c") {
+        if(command == "b" || command == "e" || command == "c") {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if(command == "b" | command == "e" | command == "c") {
// Just start with inline command leave it.
goto normal_line;
}
if(command == "b" || command == "e" || command == "c") {
// Just start with inline command leave it.
goto normal_line;
}
🤖 Prompt for AI Agents
In `@src/Support/Doxygen.cpp` around lines 145 - 148, The condition currently uses
bitwise OR between boolean expressions (if(command == "b" | command == "e" |
command == "c")) which prevents short-circuiting; update the conditional to use
logical OR (||) so comparisons short-circuit correctly and maintain intended
semantics for the check on the variable command in the same block that jumps to
normal_line.


if(command.equals_insensitive("param")) {
// Got param command
auto direction = DoxygenInfo::ParamCommandCommentContent::ParamDirection::Unspecified;
Expand Down Expand Up @@ -230,6 +235,7 @@ static void process_paragragh(llvm::SmallVector<llvm::StringRef>::iterator& line
return;
}
}
normal_line:
// Not a command block, but may include commands like '@b', '@e'
process_non_command_line(*line_ref, rest);
++line_ref;
Expand Down
Loading
Loading