protobuf
protobuf copied to clipboard
enumField grammar doesn't allow negative values
Grammar of enumField:
enumField = ident "=" intLit [ "[" enumValueOption { "," enumValueOption } "]" ]";"
intLit = decimalLit | octalLit | hexLit
decimalLit = ( "1" … "9" ) { decimalDigit }
octalLit = "0" { octalDigit }
hexLit = "0" ( "x" | "X" ) hexDigit { hexDigit }
So this should be invalid enum field declaration because negative values are not allowed.
SPARSE_D = -15;
However, this declaration exists in protobuf unittest.
This appears to have been fixed. The grammars for both proto2 and proto3 both now have the following production, explicitly allowing a minus sign:
enumField = ident "=" [ "-" ] intLit [ "[" enumValueOption { "," enumValueOption } "]" ]";"
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.
This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.