Skip to content

Conversation

epage
Copy link
Contributor

@epage epage commented Sep 4, 2025

As a reference, users are likely to jump in at random points and it can then be hard to know where to look for information on grammars.

While it would likely be overkill to link to the notation wherever there is a grammar, the grammary summary page seems like a reasonable place to at least include a link.

As a reference, users are likely to jump in at random points and it can
then be hard to know where to look for information on grammars.

While it would likely be overkill to link to the notation wherever there
is a grammar, the grammary summary page seems like a reasonable place to
at least include a link.
@epage epage marked this pull request as ready for review September 4, 2025 17:12
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Sep 4, 2025
We originally hadn't added rule identifiers to the notation chapter as
in some sense these aren't language rules.  However, as it turns out,
it's still useful to have these so as to be able to refer by name to
particular sections.  And anyway, since the language rules are defined
in terms of this notation, the notation rules are in a sense normative
at a meta level.

In doing this, we'll nest certain sections under the grammar section
that should be so nested.
We had a set of grammar rules we had placed in the notation chapter
under the label of "common productions".  There's a certain sense to
that, particularly if we had more of them.  As it is, though, all of
the productions seem related enough to the "input format" chapter, and
in fact we had already labeled these productions with the identifier
`input.syntax`, so let's go ahead and move these productions to the
"input format" chapter.  This looks more orderly, especially as we now
have rule labels in the notation chapter.
The notation itself is not the "grammar production rules", so we don't
want to use that as the link text.  Let's instead point people to the
rule identifier by name.
@traviscross traviscross removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Sep 5, 2025
@traviscross traviscross added this pull request to the merge queue Sep 5, 2025
@traviscross
Copy link
Contributor

Thanks Ed.

Merged via the queue into rust-lang:master with commit 0adfec3 Sep 5, 2025
5 checks passed
Comment on lines +4 to +15
r[input.syntax]
```grammar,lexer
@root CHAR -> <a Unicode scalar value>

NUL -> U+0000

TAB -> U+0009

LF -> U+000A

CR -> U+000D
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This feels a bit odd to reference this as the input syntax (and put it here. I would have expected input.syntax to be something like

@root INPUT -> SHEBANG? (BLANK_LINES FRONTMATTER)? TOKEN*

BLANK_LINES might refer to part of this but not all of it.

@epage epage deleted the notation branch September 5, 2025 20:05
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 8, 2025
Update books

## rust-lang/nomicon

1 commits in 57ed4473660565d9357fcae176b358d7e8724ebf..f17a018b9989430967d1c58e9a12c51169abc744
2025-09-05 22:46:58 UTC to 2025-09-05 22:46:58 UTC

- Add missing "C" ABI to FFI example code (rust-lang/nomicon#501)

## rust-lang/reference

7 commits in 89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769..b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee
2025-09-05 20:14:36 UTC to 2025-08-26 20:17:24 UTC

- Ensure all lexical elements are SCREAMING_CASE (rust-lang/reference#1990)
- Link out to the notation from grammar summary (rust-lang/reference#1989)
- Or-patterns are extending (rust-lang/reference#1975)
- Specify lifetime extension of `match` arms and `if` consequent/`else` block tail expressions (rust-lang/reference#1981)
- clean up and properly test temporary lifetime extension in doctests (rust-lang/reference#1979)
- Update `cold` and `inline` to use the attribute template (rust-lang/reference#1907)
- Pluralize "syntax diagrams" (rust-lang/reference#1977)

## rust-lang/rust-by-example

1 commits in ad27f82c18464525c761a4a8db2e01785da59e1f..dd26bc8e726dc2e73534c8972d4dccd1bed7495f
2025-09-04 22:33:29 UTC to 2025-09-04 22:33:29 UTC

- Fix drop order explanation in trait > drop (rust-lang/rust-by-example#1953)
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 9, 2025
Update books

## rust-lang/nomicon

1 commits in 57ed4473660565d9357fcae176b358d7e8724ebf..f17a018b9989430967d1c58e9a12c51169abc744
2025-09-05 22:46:58 UTC to 2025-09-05 22:46:58 UTC

- Add missing "C" ABI to FFI example code (rust-lang/nomicon#501)

## rust-lang/reference

7 commits in 89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769..b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee
2025-09-05 20:14:36 UTC to 2025-08-26 20:17:24 UTC

- Ensure all lexical elements are SCREAMING_CASE (rust-lang/reference#1990)
- Link out to the notation from grammar summary (rust-lang/reference#1989)
- Or-patterns are extending (rust-lang/reference#1975)
- Specify lifetime extension of `match` arms and `if` consequent/`else` block tail expressions (rust-lang/reference#1981)
- clean up and properly test temporary lifetime extension in doctests (rust-lang/reference#1979)
- Update `cold` and `inline` to use the attribute template (rust-lang/reference#1907)
- Pluralize "syntax diagrams" (rust-lang/reference#1977)

## rust-lang/rust-by-example

1 commits in ad27f82c18464525c761a4a8db2e01785da59e1f..dd26bc8e726dc2e73534c8972d4dccd1bed7495f
2025-09-04 22:33:29 UTC to 2025-09-04 22:33:29 UTC

- Fix drop order explanation in trait > drop (rust-lang/rust-by-example#1953)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 9, 2025
Update books

## rust-lang/nomicon

1 commits in 57ed4473660565d9357fcae176b358d7e8724ebf..f17a018b9989430967d1c58e9a12c51169abc744
2025-09-05 22:46:58 UTC to 2025-09-05 22:46:58 UTC

- Add missing "C" ABI to FFI example code (rust-lang/nomicon#501)

## rust-lang/reference

7 commits in 89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769..b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee
2025-09-05 20:14:36 UTC to 2025-08-26 20:17:24 UTC

- Ensure all lexical elements are SCREAMING_CASE (rust-lang/reference#1990)
- Link out to the notation from grammar summary (rust-lang/reference#1989)
- Or-patterns are extending (rust-lang/reference#1975)
- Specify lifetime extension of `match` arms and `if` consequent/`else` block tail expressions (rust-lang/reference#1981)
- clean up and properly test temporary lifetime extension in doctests (rust-lang/reference#1979)
- Update `cold` and `inline` to use the attribute template (rust-lang/reference#1907)
- Pluralize "syntax diagrams" (rust-lang/reference#1977)

## rust-lang/rust-by-example

1 commits in ad27f82c18464525c761a4a8db2e01785da59e1f..dd26bc8e726dc2e73534c8972d4dccd1bed7495f
2025-09-04 22:33:29 UTC to 2025-09-04 22:33:29 UTC

- Fix drop order explanation in trait > drop (rust-lang/rust-by-example#1953)
rust-timer added a commit to rust-lang/rust that referenced this pull request Sep 9, 2025
Rollup merge of #146339 - rustbot:docs-update, r=ehuss

Update books

## rust-lang/nomicon

1 commits in 57ed4473660565d9357fcae176b358d7e8724ebf..f17a018b9989430967d1c58e9a12c51169abc744
2025-09-05 22:46:58 UTC to 2025-09-05 22:46:58 UTC

- Add missing "C" ABI to FFI example code (rust-lang/nomicon#501)

## rust-lang/reference

7 commits in 89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769..b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee
2025-09-05 20:14:36 UTC to 2025-08-26 20:17:24 UTC

- Ensure all lexical elements are SCREAMING_CASE (rust-lang/reference#1990)
- Link out to the notation from grammar summary (rust-lang/reference#1989)
- Or-patterns are extending (rust-lang/reference#1975)
- Specify lifetime extension of `match` arms and `if` consequent/`else` block tail expressions (rust-lang/reference#1981)
- clean up and properly test temporary lifetime extension in doctests (rust-lang/reference#1979)
- Update `cold` and `inline` to use the attribute template (rust-lang/reference#1907)
- Pluralize "syntax diagrams" (rust-lang/reference#1977)

## rust-lang/rust-by-example

1 commits in ad27f82c18464525c761a4a8db2e01785da59e1f..dd26bc8e726dc2e73534c8972d4dccd1bed7495f
2025-09-04 22:33:29 UTC to 2025-09-04 22:33:29 UTC

- Fix drop order explanation in trait > drop (rust-lang/rust-by-example#1953)
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