commit | f1597e9e4ab87c0078dd6d24e7b93bcca0c21fcf | [log] [tgz] |
---|---|---|
author | Harry Terkelsen <het@google.com> | Thu Feb 19 14:24:53 2015 -0800 |
committer | Sergey Prigogin <eclipse.sprigogin@gmail.com> | Tue Dec 22 19:12:30 2015 -0800 |
tree | 2ac799619efe6120bbffe2e34707883c26ce4574 | |
parent | ea30ec1478a4755ab6f7809ea02e9069babf2747 [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;