diff --git a/protobuf/protobuf2/Protobuf2.g4 b/protobuf/protobuf2/Protobuf2.g4 index 437349b2d3..ce562e2715 100644 --- a/protobuf/protobuf2/Protobuf2.g4 +++ b/protobuf/protobuf2/Protobuf2.g4 @@ -266,7 +266,7 @@ constant // not specified in specification but used in tests blockLit - : LC (ident COLON constant)* RC + : LC (ident COLON constant (COMMA)?)* RC ; emptyStatement_ diff --git a/protobuf/protobuf2/examples/block.proto b/protobuf/protobuf2/examples/block.proto new file mode 100644 index 0000000000..5db19068a2 --- /dev/null +++ b/protobuf/protobuf2/examples/block.proto @@ -0,0 +1,22 @@ +syntax = 'proto2'; + +// Extracted from google/protobuf/descriptor.proto +message FeatureSet { + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0; + EXPLICIT = 1; + IMPLICIT = 2; + LEGACY_REQUIRED = 3; + } + optional FieldPresence field_presence = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + feature_support = { + edition_introduced: EDITION_2023, + }, + edition_defaults = { edition: EDITION_LEGACY, value: "EXPLICIT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, + edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } + ]; +} \ No newline at end of file