Skip to content

Commit

Permalink
feat: implement support for repeated fields in constants
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
plusvic authored and stepancheg committed Oct 15, 2024
1 parent 7f3e21e commit 5db1948
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 172 deletions.
Loading

0 comments on commit 5db1948

Please sign in to comment.