aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/parser.cc
diff options
context:
space:
mode:
authorGravatar temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d>2008-07-23 01:19:07 +0000
committerGravatar temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d>2008-07-23 01:19:07 +0000
commitf206351d1469970230caa5f61eaa54797194bee1 (patch)
tree3b1b9ea37171fdb231bca2fe6c74492eeea2abd7 /src/google/protobuf/compiler/parser.cc
parentcc930432c2823c3d82e0b8dd2ae4f446c82f4fce (diff)
Sync code with Google-internal branch. Changes:
Protoc (parser) - Improved error message when an enum value's name conflicts with another symbol defined in the enum type's scope, e.g. if two enum types declared in the same scope have values with the same name. This is disallowed for compatibility with C++, but this wasn't clear from the error. C++ - Restored the set_foo(const char*) accessor for "bytes" type because some code inside Google depends on it. However, set_foo(const char*, int) is still there (and actually is changed to take const void*). - Fixed TokenizerTest when compiling with -DNDEBUG on Linux. - Other irrelevant tweaks. Java - Fixed UnknownFieldSet's parsing of varints larger than 32 bits. - Fixed TextFormat's parsing of "inf" and "nan". - Fixed TextFormat's parsing of comments. Python - Fixed text_format_test on Windows where floating-point exponents sometimes contain extra zeros.
Diffstat (limited to 'src/google/protobuf/compiler/parser.cc')
-rw-r--r--src/google/protobuf/compiler/parser.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc
index 622895ff..3b73530b 100644
--- a/src/google/protobuf/compiler/parser.cc
+++ b/src/google/protobuf/compiler/parser.cc
@@ -1034,6 +1034,9 @@ bool Parser::ParseUserDefinedType(string* type_name) {
bool Parser::ParsePackage(FileDescriptorProto* file) {
if (file->has_package()) {
AddError("Multiple package definitions.");
+ // Don't append the new package to the old one. Just replace it. Not
+ // that it really matters since this is an error anyway.
+ file->clear_package();
}
DO(Consume("package"));