Accept trailing comma on field extension list.
Right now trailing commas on field extensions are considered to be a missing identifiers.
Re-produce as:
protoc \
<(echo 'syntax = "proto3";\npackage test;\nimport "google/protobuf/descriptor.proto";\nextend google.protobuf.FieldOptions {\n int32 a = 50000;\n int32 b = 50001;\n}\nmessage Test {\n int32 test = 1 [(a) = 1, (b) = 2,];\n}') \
--cpp_out $(mktemp -d) \
--proto_path /proc/self/fd/
(tested on 3.6.1)
Removing the comma at the end of (b) = 2, allows it to compile.
What language does this apply to?
Proto3 (presumably the same in proto2)
Describe the problem you are trying to solve.
I'd like to be able to supply trailing commas.
Describe the solution you'd like
Trailing commas are allowed.
What is the use case for this? Is it for easy copy paste when you have one line per option? eg.
syntax = "proto3";
package test;
import "google/protobuf/descriptor.proto";
extend google.protobuf.FieldOptions {
int32 a = 50000;
int32 b = 50001;
}
message Test {
int32 test = 1 [
(a) = 1,
(b) = 2,
];
}
What is the use case for this? Is it for easy copy paste when you have one line per option?
Yes, easy re-ordering of lines would be nice, also seems more consistent.
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.