mycoolmc / protobuf-dt

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

Enum Value Options result in a syntax error #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a proto file with the following:

import "descriptor.proto";

extend google.protobuf.EnumValueOptions {
    optional string foo = 50000;
}

enum FooBar {
    BAR = 1 [(foo)="foobar"];
}

2. Observe that the Enum Value Option "foo" results in a syntax error ([ is 
unexpected)

What is the expected output? What do you see instead?

The Enum Value Option should not result in a syntax error.

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

1.0.0
Eclipse 3.7 PDE
Windows 7 x64

Please provide any additional information below.

While custom options are not yet fully supported, they are only actively 
reported as syntax errors on Enum Values.

Original issue reported on code.google.com by compuwar...@gmail.com on 4 Aug 2011 at 3:12

GoogleCodeExporter commented 9 years ago

Original comment by alr...@google.com on 4 Aug 2011 at 6:32

GoogleCodeExporter commented 9 years ago
I haven't had enough time to look into all the additions required to source to 
treat these as comprehensively as FieldOptions, but the grammar change to 
accept the structural syntax at least is simple:

Literal:
  name=Name '=' index=(INT | HEX) 
   ('[' enumValueOptions+=EnumValueOption (',' enumValueOptions+=EnumValueOption)* ']')?
  ';';

EnumValueOption:
  BuiltInEnumValueOption | CustomEnumValueOption;

BuiltInEnumValueOption:
  name=Name '=' value=ValueRef;

CustomEnumValueOption:
  '(' name=QualifiedName ')' '=' value=ValueRef;

...notably there are no built in enum value options.

Original comment by compuwar...@gmail.com on 4 Aug 2011 at 9:30

GoogleCodeExporter commented 9 years ago
r114f404b76a5

Original comment by alr...@google.com on 8 Aug 2011 at 1:26