Lack of precedence in OR clause causes lexical ambiguity for comments
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- compilers, documentation
Research direction
Start with the linked BLOCK_COMMENT_OR_DOC, OUTER_BLOCK_DOC, and BLOCK_COMMENT grammar, then review the linked notation rules for how competing alternatives are resolved. Reproduce the compiler behavior for /**/* */ and compare it with the documented grammar. Done means reaching and documenting a clear resolution for the precedence ambiguity.
Written by the indexing model from the issue text.
Description
/**/* */*/, in its entirety, is a valid BLOCK_COMMENT_OR_DOC if and only if the outer comment is interpreted as an OUTER_BLOCK_DOC AFAICT. The beginning of the stream also matches as a BLOCK_COMMENT however, which will match only /**/, leaving the rest as remaining tokens (which appears to be the compiler's current behavior).
The notation gives precedence to sequences over the OR operator but does not define precedence when multiple branches are candidates.
I believe the latter may be too notable of a change over updating the comment syntax here, but I'm also unsure the likelihood this was an assumption never actually written which should be included. I also know the comment syntax is also incredibly verbose. I'm happy to leave that question to those with experience.
Also, apologies if I did make a mistake or miss something. I'd be happy to hear why this is invalid :)
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/reference
-
A-const-eval A-undefined-behavior
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
A-resolve
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
A-coercions
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
All issues in rust-lang/reference
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100