Skip to content
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

Support "-nan" in TextFormat. #1651

Merged
merged 1 commit into from
May 9, 2024
Merged

Support "-nan" in TextFormat. #1651

merged 1 commit into from
May 9, 2024

Conversation

thomasvl
Copy link
Collaborator

@thomasvl thomasvl commented May 9, 2024

As odd as it sounds, upstream supports this and there is a unittest that ensure it parses:

https://github.com/protocolbuffers/protobuf/blob/3c03e9351c57081d0dffae120ed37497017f105c/src/google/protobuf/compiler/parser_unittest.cc#L464

It seems to have come from:

protocolbuffers/protobuf#15017

So make sure Swift is also able to parse it.

Also reflow some of the unknown field parsing as inf/nan don't need to be special cased with how the flow now works.

As odd as it sounds, upstream supports this and there is a unittest that
ensure it parses:

  https://github.com/protocolbuffers/protobuf/blob/3c03e9351c57081d0dffae120ed37497017f105c/src/google/protobuf/compiler/parser_unittest.cc#L464

It seems to have come from:

  protocolbuffers/protobuf#15017

So make sure Swift is also able to parse it.

Also reflow some of the unknown field parsing as inf/nan don't need to be
special cased with how the flow now works.
@thomasvl thomasvl requested review from allevato and tbkka May 9, 2024 14:09
@thomasvl thomasvl merged commit 793b14f into apple:main May 9, 2024
10 of 11 checks passed
@thomasvl thomasvl deleted the negative_nan branch May 9, 2024 16:09
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.

None yet

3 participants