Commit a1306cc
feat: implement support for repeated fields in constants
This adds support for repeated fields in constants. Until know the following was failing with a parsing error:
```protobuf
optional uint64 my_field = 1 [ (my_option) = { my_option_repeated_field: ["foo", "bar"] } ];
```
This is valid for `protoc` and it's covered in the specification, but the parser wasn't accepting the `["foo", "bar"]`
syntax for assigning a value to the repeated field.
Some refactoring was required to implement this. Particularly, the functions `option_value_field_to_unknown_value`
and `option_value_message_to_unknown_value`, which returned `UnknownValue`, now receive a mutable `UnknownFields`
and add new fields to it. These function where renamed to more appropriate names.1 parent 2351c97 commit a1306cc
File tree
3 files changed
+243
-172
lines changed- protobuf-parse/src/pure
- convert
3 files changed
+243
-172
lines changed
0 commit comments