jasonjack2015 / protobuf

Automatically exported from code.google.com/p/protobuf
Other
0 stars 0 forks source link

need to give a tag for all repeated booleans? #314

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. extract from the message definition in the *.proto file
message LithologyProperty_GMT {
    required string lithology = 1;
    required PropertyType property = 2;
    optional ProbabilityDistributionFunction_GMT ProbabilityDistributionFunction = 3;
    optional bool fixed = 4 [ default = false];  // moveable field
    optional int32 index_voxet_key = 5;  // index field
    //  bool array list to indicate possible formation below current formation
    //  a normal pile ordering is achieved with "trues" in the top triangle 
    //  an overturned pile ordering is achieved with "trues" in the lower triangle 
    optional ctm.RepeatedBool preserve = 6; // PreserveVerticalRelationship, current
}
2. ASCII file that I wish to parse
LithologyProperty {lithology:"h_CAMBRIAN";property: 
Susceptibility;ProbabilityDistributionFunction {type:LogNormal;mean: 
0.0009; stddev: 0.00004;}
    preserve: {node:0;0;0;1;1;1;1;1;1;1;}}

I expect to be able to avoid using the tag for each repeated instance?

What do you see instead?
Parse error, as I cannot guess which way to do it.

What version of the product are you using?
2.4 On what operating system?  Vista

Please provide any additional information below.

Original issue reported on code.google.com by desmondj...@gmail.com on 10 Jul 2011 at 10:18

GoogleCodeExporter commented 9 years ago
What language? In C++ at least there is a "short repeated format" available for 
short repeated primitives, e.g>:
preserve: { node: [ 0, 0, 0, 1, 1, 1, ... ] }

I think there was some change to support parsing this format in Java, but I 
don't think it has hit the open source release yet.

Original comment by jas...@google.com on 15 Jul 2011 at 7:30

GoogleCodeExporter commented 9 years ago

Original comment by xiaof...@google.com on 10 Oct 2014 at 1:20