Skip to content

Remove RESERVED_NUMBER#2193

Open
ehuss wants to merge 1 commit intorust-lang:masterfrom
ehuss:remove-reserved-number
Open

Remove RESERVED_NUMBER#2193
ehuss wants to merge 1 commit intorust-lang:masterfrom
ehuss:remove-reserved-number

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Feb 25, 2026

This removes RESERVED_NUMBER and instead embeds the correctness requirements for a number in the literal productions using the cut operator.

I like the idea of inlining these requirements into the grammar so that the restrictions are clear and nearer to the rules they are related to.

I'm on the fence about keeping the rules describing the restrictions. In general we don't want to describe the grammar in English due to the potential ambiguity. If we do this here, why wouldn't we do this everywhere there is a cut operator? However, I think it's still helpful to include in this case.

SUFFIX_NO_E is no longer needed because all of the other rules handle rejecting the E.

This removes RESERVED_NUMBER and instead embeds the correctness
requirements for a number in the literal productions using the cut
operator.

I like the idea of inlining these requirements into the grammar so that
the restrictions are clear and nearer to the rules they are related to.

I'm on the fence about keeping the rules describing the restrictions. In
general we don't want to describe the grammar in English due to the
potential ambiguity. If we do this here, why wouldn't we do this
everywhere there is a cut operator? However, I think it's still helpful
to include in this case.

SUFFIX_NO_E is no longer needed because all of the other rules handle
rejecting the E.
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants