Skip to content

Fix recently discovered discrepancies with protoc#229

Merged
jhump merged 3 commits intomainfrom
jh/grammar-fixes
Dec 13, 2023
Merged

Fix recently discovered discrepancies with protoc#229
jhump merged 3 commits intomainfrom
jh/grammar-fixes

Conversation

@jhump
Copy link
Member

@jhump jhump commented Dec 12, 2023

Removes support for explicit positive sign + before numeric literals since that is not supported by protoc. Also adds support for -nan (with negative sign) in option values as well as case-insensitive inf, and infinity, and nan in message literals, all of which are allowed by protoc.

While in here, I tweaked some of the error messages for recently-added lenience to more closely resemble the syntax errors previously produced.

Fixes #223
Fixes #225

…in numeric literals, allow negative nan in option values, allow case-insensitive inf, infinity, and nan in message literals
@jhump jhump requested a review from Alfus December 12, 2023 02:59
@jhump
Copy link
Member Author

jhump commented Dec 12, 2023

cc @jacobbuf

@jhump jhump merged commit 72d7e68 into main Dec 13, 2023
@jhump jhump deleted the jh/grammar-fixes branch December 13, 2023 15:24
jhump added a commit to jhump/protoreflect that referenced this pull request Dec 13, 2023
kralicky added a commit to kralicky/protocompile that referenced this pull request Feb 7, 2024
Removes support for explicit positive sign `+` before numeric literals
since that is not actually supported by `protoc`. Also adds support for
`-nan` (with negative sign) in option values as well as case-insensitive
`inf`, and `infinity`, and `nan` in message literals, all of which are
allowed by `protoc`.
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.

Discrepancies with protoc related to Infinity and NaN in numeric literals handle +1 and the like consistently with the Google proto compiler

2 participants