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

Closed
wants to merge 1 commit into from

Conversation

steffahn
Copy link
Member

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.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@steffahn
Copy link
Member Author

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
Copy link
Member Author

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.

@ehuss
Copy link
Contributor

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
Member Author

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

@steffahn steffahn closed this by deleting the head repository Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants