Skip to content

Block comment grammar #1588

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

Closed
mikesamuel opened this issue Jan 21, 2012 · 3 comments
Closed

Block comment grammar #1588

mikesamuel opened this issue Jan 21, 2012 · 3 comments
Labels
A-grammar Area: The grammar of Rust

Comments

@mikesamuel
Copy link

http://doc.rust-lang.org/doc/rust.html#comments describes the grammar of block comments as

block_comment : "/" block_comment_body * "/" ;
block_comment_body : block_comment | non_star * | '*' non_slash ;

Since non_slash matches '*', this would mean that

/***/

is not a full block comment, because the */ at the end matches '' non_slash, and then '/' is left to match non_star.

/***/*/

is a single block comment token.

Perhaps

'*' non_slash

should be

'*'+ non_star_slash

Also, if the block_comment in block_comment_body is meant to allow nested comments, then

non_star *

should probably also use non_star_slash to give the unambiguous

block_comment : "/" block_comment_body * "/" ;
block_comment_body : block_comment | ("*" *) non_star_slash ;

@ghost ghost assigned graydon Apr 12, 2012
@z0w0
Copy link
Contributor

z0w0 commented Mar 27, 2013

I think this has been fixed somewhere along the line. Can you confirm?

@jbclements
Copy link
Contributor

The parser does the right thing, but I agree with the poster that the specified grammar is broken. The proposed fix doesn't quite work, but putting the '+' on the star at the end does work.

jbclements added a commit to jbclements/rust that referenced this issue Mar 27, 2013
bors added a commit that referenced this issue Mar 29, 2013
…r, r=jbclements

... by adding Kleene '+' in two places, and changing a "non-slash" into "non_slash_or_star".

Closes #1588
@jbclements
Copy link
Contributor

fixed by #5583 , I believ.

celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
)

Add a new module reachability which implements the reachability algorithm. Add the end to end logic for the reachability starting from all the harnesses in the target crate.

## Resolved issues:

Resolves rust-lang#1672

## Related RFC:

rust-lang#1588

## Call-outs:

    We still need to build the custom sysroot in order to fix the missing functions issue.
    I added a mechanism to run the regression tests using the MIR linker inside compiletest.
    I ran the regression manually (with the mir_linker enabled) the only tests that didn't pass were:
        cargo-kani/asm/global_error/doesnt_call_crate_with_global_asm.expected: The global assembly is out of the scope so it doesn't get processed. If we want to keep that behavior, we will have to inspect all items manually.
        cargo-kani/cargo-tests-dir/expected: This might be a legit issue that I need to fix on kani-driver logic.
        cargo-ui/dry-run/expected: Not an issue (arguments to the compiler changes).
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust
Projects
None yet
Development

No branches or pull requests

4 participants