-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Lex nested block comments #9468
Comments
I thought we were going to grow a macro to handle block quotes. Did that ever get implemented? |
@erickt I don't know what you mean by block quotes. |
Accepted for feature-complete |
Don't line comments address pretty much all uses of nested block comments? |
@brson: by block quote, I mean in the style of CPP's
|
From what I've gathered from the code, there are two implementations of the comment parsing, one of which supports nested comments, so I guess #9701 should be fixed before this bug. |
That's pretty funny that the pretty printer already supports nested comments. I don't think they necessarily have to be merged to fix this bug, though our lexing is a bit of a mess. |
@madjar Are you going to tackle this? |
@brson If there's no massive refactoring to do, I can try! Expect a PR soon. |
This should close #9468. I removed the test stating that nested comments should not be implemented. I had a little chicken-and-egg problem because a comment of the std contains "/*", and adding support for nested comment creates a backward incompatibility in that case, so I had to use a dirty hack to get stage1 and stage2 to compile. This part should be revert when this commit lands in a snapshot. This is my first non-typo contribution, so I'm open to any comment.
This should close #9468. I removed the test stating that nested comments should not be implemented. I had a little chicken-and-egg problem because a comment of the std contains "/*", and adding support for nested comment creates a backward incompatibility in that case, so I had to use a dirty hack to get stage1 and stage2 to compile. This part should be revert when this commit lands in a snapshot. This is my first non-typo contribution, so I'm open to any comment.
The reference manual says "Comments in Rust code follow the general C++ style of line and block-comment forms, with no nesting of block-comment delimiters" ... right after production rules for nested comments. |
Fix FormatArgsExpn parsing of FormatSpec positions Woops, forgot visitors don't walk themselves Fixes rust-lang#9468 r? `@giraffate` changelog: none
Currently we don't support nested block comments. This allows lexing to be regular, but it widely seen as an inconvenience. Modify the lexer to keep track of comment nesting.
Nominating backcompat.
The text was updated successfully, but these errors were encountered: