RFR: JDK-8305713: DocCommentParser: merge blockContent and inlineContent [v6]

Jonathan Gibbons jjg at openjdk.org
Wed Apr 19 16:40:47 UTC 2023

On Wed, 19 Apr 2023 15:49:44 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision:
>>   address review feedback
> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 84:
>> 82:         /** The initial part of a doc comment, or the rich-text content of a block tag. */
>> 83:         BODY,
>> 84:         /** The end of an HTML file, from and including the {@code </main>} or {@code </body>} tag. */
> Shouldn't there be the adjective _possible_ similarly to PREAMBLE? I assume, the idea here is as follows. The `body` element encloses the optional `main` element. If the `main` element is enclosed, then the PREAMBLE phase ends with the `main` start tag and the POSTAMBLE phase starts with the `main` end tag. Otherwise, PREAMBLE ends with the `body` start tag and POSTAMBLE starts with the `body` end tag. Is this correct?

Yes, that's essentially correct, but the code is somewhat more tolerant.  
The wording was trying to express the implementation detail that PREAMBLE goes up to the `<body>` and then checks for `<main>`, whereas the BODY ends (and PREAMBLE begins) with _either_ `</main>` or `</body>`, whichever is found first.  In other words, we lazily accept a malformed file with `...<body><main>...</body>`.


PR Review Comment: https://git.openjdk.org/jdk/pull/13431#discussion_r1171597038

More information about the compiler-dev mailing list