Skip to content

Commit 5a3769a

Browse files
fix: invalid syntax in descriptor.proto (#2092)
A recent change (#2075) edited descriptor.proto to include a `reserved` statement that combines a field number and field name in the same line. This is specifically called out in the proto language guide as invalid. https://protobuf.dev/programming-guides/editions/#reserved > Note that you can’t mix field names and numeric values in the same > `reserved` statement. Protobuf.js itself seems to handle this syntax just fine, but other tools like protoc will choke on it.
1 parent f42297b commit 5a3769a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

google/protobuf/descriptor.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,11 @@
588588
42,
589589
42
590590
],
591-
"php_generic_services",
592591
[
593592
38,
594593
38
595-
]
594+
],
595+
"php_generic_services"
596596
],
597597
"nested": {
598598
"OptimizeMode": {

google/protobuf/descriptor.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ message FileOptions {
229229

230230
extensions 1000 to max;
231231

232-
reserved 42, "php_generic_services", 38;
232+
reserved 42, 38;
233+
reserved "php_generic_services";
233234
}
234235

235236
message MessageOptions {

0 commit comments

Comments
 (0)