Skip to content

Correct bogus ABNF syntax matching literal numbers #614

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

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

alerque
Copy link
Contributor

@alerque alerque commented Jan 23, 2024

The 0 here was evidently meant to represent a literal character 0, but as I understand ABNF this would be interpreted as a counter modifier for a later item. It would be quoted as a string "0", but the later range [0-9] is not quite so easy. To be a range one kind of needs to specify the actual character codes (as is done elsewhere in this very grammar). I encoded the zero as %x30 and the range one-to-nine as %x31-39 so all the literal digits are represented the same way.

@CLAassistant
Copy link

CLAassistant commented Jan 23, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

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

Wow, I'm surprised we missed this for so long. Thanks!

@aphillips
Copy link
Member

@alerque Thank you so much!

Please sign the CLA or contact me if you have any questions/problems.

The `0` here was evidently meant to represent a literal character 0, but
as I understand ABNF this would be interpreted as a counter modifier for
a later item. It would be quoted as a string `"0"`, but the later range
`[0-9]` is not quite so easy. To be a range one kind of needs to specify
the actual character codes (as is done elsewhere in this very grammar).
I encoded the zero as `%x30` and the range one-to-nine as `%x31-39` so
all the literal digits are represented the same way.
@alerque
Copy link
Contributor Author

alerque commented Jan 23, 2024

As the CLA bot above shows I've already signed for a previous commit contribution.

This bogus syntax was introduced in #553.

@aphillips aphillips merged commit f9b0c6f into unicode-org:main Jan 23, 2024
@alerque alerque deleted the fix-bogus-abnf branch January 23, 2024 19:52
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.

4 participants