Fix BLOCK_COMMENT in the context of SHEBANG

This fixes an issue with the BLOCK_COMMENT grammar as it is used within
the SHEBANG rule. The problem is that BLOCK_COMMENT was changed in
https://github.com/rust-lang/reference/pull/2191 so that it relied on
the order of how the comments were handled in the COMMENT rule to avoid
ambiguity with OUTER_BLOCK_DOC. However, because SHEBANG is using the
BLOCK_COMMENT rule directly, we need BLOCK_COMMENT to be able to stand
on its own without relying on the order in COMMENT.

This fixes an issue with shebang such as:

	#! /** doc */ [attr]

Here this should be treated as a shebang (because it is a doc block
comment).

The solution is to do the appropriate negative lookahead to exclude
OUTER_BLOCK_DOC and INNER_BLOCK_DOC.
1 file changed
tree: 7ab5f2e37e57c7d17f36dd75665c1a8c03b0ddb1
  1. .cargo/
  2. .github/
  3. dev-guide/
  4. docs/
  5. src/
  6. theme/
  7. tools/
  8. .gitattributes
  9. .gitignore
  10. book.toml
  11. Cargo.lock
  12. Cargo.toml
  13. CONTRIBUTING.md
  14. LICENSE-APACHE
  15. LICENSE-MIT
  16. README.md
  17. reference.md
  18. rust-toolchain.toml
  19. rustfmt.toml
  20. triagebot.toml
README.md

The Rust Language Reference

This document is the primary reference for the Rust programming language.

Contributor docs

See the Reference Developer Guide for information on contributing to the Reference.