Conversation
Transform 2 aborted a whole comment if any whitespace-delimited "@word" that is not @param/@return appeared anywhere in it. Real Doxygen prose cross-references its arguments ("need not be a multiple of @align", "Pointer to at least @SiZe bytes"), so essentially every such comment bailed and never converted. That is the common case, not a corner. A "@name"/"\name" is now a cross-reference rather than a foreign tag when the same comment declares that parameter and the name is not a DOXY_TAGS keyword in its own right. Line position looks like the sharper discriminator and is not, because reflow owns line position: a comment this aborts on is still re-wrapped, the line-leading "@file" merges into the line above, and a position test then reads it mid-line and converts what the run before refused. A name-only test cannot move under the packer. Declarations come from the tag region only, read as one word stream so a "@PARAM" ending a line still declares the name that opens the next one. One-character C escapes are excluded after trailing punctuation is trimmed, so "\n" and "\n." agree. A parameter named after a convertible tag keyword is refused outright: "@PARAM return desc" emitted "@return : desc", which the next run read as a return tag and rewrote again. Entries then hang their continuations under the description column, the way a @PARAM entry already did, so the two forms match once one comment in a file converts and its neighbor aborts. A nonzero hang made a latent packer bug reachable: classify_lines has always split a paragraph at a "@name :" line, but while entries wrapped flush the regrouping moved no bytes. Three rules close it. The packer will not forge that shape by joining a lone "@name" to a ":"-led word on a continuation line, which has to be caught at the append because is_kernel_doc_tag reads the line start and no later word can clear it. It will not split a paragraph's opening line between "@name" and its colon, overflowing instead. And the end-of-paragraph borrow no longer hands a tag word down to open a continuation line. That borrow also had a pre-existing data-loss bug the hang exposed: the fold arm sat inside the "there is a word to borrow" case, so a one-word line above fell through and emitted a bare rule alone, which transform 1 deletes on the next run. Comments across the repo are reflowed by the tool itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transform 2 aborted a whole comment if any whitespace-delimited "@word" that is not @param/@return appeared anywhere in it. Real Doxygen prose cross-references its arguments ("need not be a multiple of @align", "Pointer to at least @SiZe bytes"), so essentially every such comment bailed and never converted. That is the common case, not a corner.
A "@name"/"\name" is now a cross-reference rather than a foreign tag when the same comment declares that parameter and the name is not a DOXY_TAGS keyword in its own right. Line position looks like the sharper discriminator and is not, because reflow owns line position: a comment this aborts on is still re-wrapped, the line-leading "@file" merges into the line above, and a position test then reads it mid-line and converts what the run before refused. A name-only test cannot move under the packer. Declarations come from the tag region only, read as one word stream so a "@PARAM" ending a line still declares the name that opens the next one. One-character C escapes are excluded after trailing punctuation is trimmed, so "\n" and "\n." agree.
A parameter named after a convertible tag keyword is refused outright: "@PARAM return desc" emitted "@return : desc", which the next run read as a return tag and rewrote again.
Entries then hang their continuations under the description column, the way a @PARAM entry already did, so the two forms match once one comment in a file converts and its neighbor aborts. A nonzero hang made a latent packer bug reachable: classify_lines has always split a paragraph at a "@name :" line, but while entries wrapped flush the regrouping moved no bytes. Three rules close it. The packer will not forge that shape by joining a lone "@name" to a ":"-led word on a continuation line, which has to be caught at the append because is_kernel_doc_tag reads the line start and no later word can clear it. It will not split a paragraph's opening line between "@name" and its colon, overflowing instead. And the end-of-paragraph borrow no longer hands a tag word down to open a continuation line.
That borrow also had a pre-existing data-loss bug the hang exposed: the fold arm sat inside the "there is a word to borrow" case, so a one-word line above fell through and emitted a bare rule alone, which transform 1 deletes on the next run.
Comments across the repo are reflowed by the tool itself.
Summary by cubic
Converts Doxygen comments that reference their own parameters instead of aborting on unknown “@word” tokens. Previously any non-@param/@return “@word” aborted the comment; now “@name”/“\name” that matches a declared param is treated as prose, while real foreign tags still abort. Kernel-doc entries now hang their continuations under the description column, which may rewrap many comments. A param named after a convertible keyword (for example “return”) forces pass-through to keep rewrites idempotent.
New Features
Bug Fixes
Written for commit e4ccd2b. Summary will update on new commits.