The Wayback Machine - https://web.archive.org/web/20201228171000/https://github.com/rust-lang/reference/pull/778
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos, misformattings and small mistakes in the lexical structure reference. #778

Open
wants to merge 1 commit into
base: master
from

Conversation

@steffahn
Copy link
Contributor

@steffahn steffahn commented Mar 11, 2020

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.

@ehuss
ehuss approved these changes Mar 11, 2020
Copy link
Collaborator

@ehuss ehuss left a comment

Thanks!

@steffahn
Copy link
Contributor Author

@steffahn steffahn commented Mar 11, 2020

Just noticing, perhaps the IsolatedCR should be disallowed in the front part of OUTER_LINE_DOC, too...
Furthermore – but on this part I’m not sure about what exactly \n and IsolatedCR mean here – should IsolatedCR also be disallowed in LINE_COMMENT?

@steffahn steffahn force-pushed the steffahn:fix_typos branch from 5b04b7e to 281dc7b Mar 11, 2020
@steffahn
Copy link
Contributor Author

@steffahn steffahn commented Mar 11, 2020

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 ~* most likely needs an IsolatedCR excluded, too. Will add this to the commit aswell.

@steffahn steffahn force-pushed the steffahn:fix_typos branch from 281dc7b to e66ad8e Mar 11, 2020
@ehuss
Copy link
Collaborator

@ehuss ehuss commented Mar 11, 2020

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.)

@steffahn
Copy link
Contributor Author

@steffahn steffahn commented Mar 11, 2020

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.
Finally, and this may just be me not quite getting how these grammars are supposed to be read regarding maximum munch etc... but I feel like I’m missing that /* be disallowed, too, inside the BLOCK_COMMENT rules where it currently says “~*/”.

@Centril
Copy link
Contributor

@Centril Centril commented Mar 11, 2020

(I'll leave this PR open for a bit to see if @Centril wants to look.)

cc @petrochenkov @matklad -- I'm not too familiar with the lexer myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.