Lowering doc-comments
This phase of processing converts an input sequence of fine-grained tokens to a new sequence of fine-grained tokens.
The new sequence is the same as the input sequence,
except that each LineComment
or BlockComment
token whose style is inner doc or outer doc is replaced with the following sequence:
Punctuation
with mark #Whitespace
Punctuation
with mark ! (omitted if the comment token's style is outer doc)Punctuation
with mark [Identifier
with represented identifier docPunctuation
with mark =Whitespace
RawStringLiteral
with the comment token's body as the represented string and empty suffixPunctuation
with mark ]
Note: the whitespace tokens aren't observable by anything currently described in this writeup, but they explain the
spacing
in the tokens that proc-macros see.