diff options
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index d42a0b000b2..838a56c338e 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -731,6 +731,15 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) continue; // Ignore class definitions } + if(printError && matches.front()->name() != sc) + { + string msg; + msg = "type name `" + sc; + msg += "' is capitalized inconsistently with its previous name: `"; + msg += matches.front()->scoped() + "'"; + _unit->warning(msg); // TODO: change to error in stable_39 + } + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); if(!cl) { @@ -760,6 +769,15 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) continue; // Ignore class definitions } + if(printError && matches.front()->name() != sc) + { + string msg; + msg = "type name `" + sc + "' is capitalized inconsistently with its previous name: `"; + msg += matches.front()->scoped() + "'"; + _unit->warning(msg); // TODO: change to error in stable_39 + } + + ExceptionPtr ex = ExceptionPtr::dynamicCast(*p); if(ex) { @@ -839,7 +857,16 @@ Slice::Container::lookupContained(const string& scoped, bool printError) if(!ClassDefPtr::dynamicCast(*p)) // Ignore class definitions { results.push_back(*p); + + if(printError && (*p)->name() != sc) + { + string msg; + msg = "`" + sc + "' is capitalized inconsistently with its previous name: `"; + msg += (*p)->scoped() + "'"; + _unit->warning(msg); // TODO: change to error in stable_39 + } } + } if(results.empty()) @@ -867,7 +894,7 @@ Slice::Container::lookupContained(const string& scoped, bool printError) ExceptionPtr Slice::Container::lookupException(const string& scoped, bool printError) { - ContainedList contained = lookupContained(scoped, printError); + ContainedList contained = lookupContained(scoped, false); if(contained.empty()) { return 0; @@ -888,6 +915,13 @@ Slice::Container::lookupException(const string& scoped, bool printError) } return 0; } + if(printError && (*p)->name() != scoped) + { + string msg; + msg = "exception name `" + scoped + "' is capitalized inconsistently with its previous name: `"; + msg += (*p)->scoped() + "'"; + _unit->warning(msg); // TODO: change to error in stable_39 + } exceptions.push_back(ex); } assert(exceptions.size() == 1); @@ -2819,7 +2853,7 @@ Slice::Unit::currentIncludeLevel() const void Slice::Unit::error(const char* s) { - cerr << _currentFile << ':' << _currentLine << ": " << s << endl; + cout << _currentFile << ':' << _currentLine << ": " << s << endl; _errors++; } @@ -2832,7 +2866,7 @@ Slice::Unit::error(const string& s) void Slice::Unit::warning(const char* s) const { - cerr << _currentFile << ':' << _currentLine << ": warning: " << s << endl; + cout << _currentFile << ':' << _currentLine << ": warning: " << s << endl; } void |