commit | 1b59e2de1df58e2926587c1b2e8d6cc1dbe3e16c | [log] [tgz] |
---|---|---|
author | Harry Terkelsen <het@google.com> | Thu Feb 19 14:24:53 2015 -0800 |
committer | Harry Terkelsen <het@google.com> | Thu Feb 19 14:24:53 2015 -0800 |
tree | 2ac799619efe6120bbffe2e34707883c26ce4574 | |
parent | 6ffd4e7d4872cdcbabc89b861bfddc3c86b26fea [diff] |
Allow fields to be named "map" Change-Id: I41b089b1e6cc6901a28e36e756881f8c45a96356
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/MapSyntaxTest.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/MapSyntaxTest.java index 2bc0901..b0deef9 100644 --- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/MapSyntaxTest.java +++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/MapSyntaxTest.java
@@ -36,4 +36,14 @@ boolean isValid = validator.validate(xtext.root(), new BasicDiagnostic(), null); assertTrue(isValid); } + + // syntax = "proto2"; + // + // message Foo { + // optional string map = 1; + // } + @Test public void shouldAllowFieldsNamedMap() { + boolean isValid = validator.validate(xtext.root(), new BasicDiagnostic(), null); + assertTrue(isValid); + } }
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext index 2088607..2176735 100644 --- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext +++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
@@ -250,7 +250,7 @@ 'package' | 'import' | 'public' | 'option' | 'extend' | 'message' | 'optional' | 'required' | 'repeated' | 'enum' | 'service' | 'rpc' | 'stream' | 'returns' | 'default' | 'extensions' | 'to' | 'max' | 'true' | 'false' | 'double' | 'float' | 'int32' | 'int64' | 'uint32' | 'uint64' | 'sint32' | 'sint64' | 'fixed32' | 'fixed64' | - 'sfixed32' | 'sfixed64' | 'bool' | 'string' | 'bytes' | 'weak'; + 'sfixed32' | 'sfixed64' | 'bool' | 'string' | 'bytes' | 'weak' | 'map'; SimpleValueLink: LiteralLink | BooleanLink | NumberLink | StringLink;