Fix some typos, misformattings and small mistakes in the lexical structure reference. #778
Conversation
Thanks! |
Just noticing, perhaps the IsolatedCR should be disallowed in the front part of OUTER_LINE_DOC, too... |
Hm.. looking at it further, so far IsolatedCR is only forbidden in anything “DOC” comment, so perhaps it is allowed within a LINE_COMMENT. [Edit: tested it, it is allowed, also the paragraph below mentions CRs in doc comments, I just noticed.] But I found another mistake in the beginning of OUTER_BLOCK_DOC where the ~ |
Yea, that seems correct. Also, just FYI, there are a number of problems with the lexer chapter. CRLF handling was recently rewritten, which hasn't been updated in the reference. See #626. Also, I've been meaning to rewrite the lexer chapter, since it is a bit disorganized right now (#567 mentions some of the problems). If you're interested in working on those (or any issues), that would be great! (I'll leave this PR open for a bit to see if @Centril wants to look.) |
Another thing I noticed: The whole thing with BlockCommentOrDoc is totally wrong regarding IsolatedCR s. As far as a few quick tests are telling me, what actually matters is if the whole comment is a block comment or not, not if nested comments happen to be syntactically like a doc comment or a normal comment. |
cc @petrochenkov @matklad -- I'm not too familiar with the lexer myself. |
Multiple unrelated things in one commit since they’re each very small corrections.
Next to typos and bad formatting, this PR changes a word (“equivalent” ⟶ “equal”) and adds (more precisely, disallows) “\n” in a few obvious places in comments’ lexical structure.