diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-10-31 15:54:21 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-10-31 15:54:21 -0400 |
commit | 107e03ea13e0eba9c33f120f0d95ac9fefc7dcad (patch) | |
tree | 00191b7ccb83fe436ad61bdbb43b523f431c6698 /cpp/src/Slice/Parser.cpp | |
parent | Update 3.7 changelog (diff) | |
download | ice-107e03ea13e0eba9c33f120f0d95ac9fefc7dcad.tar.bz2 ice-107e03ea13e0eba9c33f120f0d95ac9fefc7dcad.tar.xz ice-107e03ea13e0eba9c33f120f0d95ac9fefc7dcad.zip |
Replaced slice compiler options --ice, --underscore and --dll-export by
global metadata directives (ice-prefix, underscore, cpp:dll-export:SYMBOL and objc:dll-export:SYMBOL)
Added new cs:tie and java:tie metadata
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index e1a88c3f559..e6e8fb768a6 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -2426,23 +2426,34 @@ Slice::Container::checkIdentifier(const string& name) const // // For rules controlled by a translator option, we don't complain about included files. // - _unit->error("illegal underscore in identifier `" + name + "'"); + + DefinitionContextPtr dc = _unit->currentDefinitionContext(); + assert(dc); + if(dc->findMetaData("underscore") != "underscore") // no "underscore" global metadata + { + _unit->error("illegal underscore in identifier `" + name + "'"); + } } + // + // For rules controlled by a translator option, we don't complain about included files. + // if(_unit->currentIncludeLevel() == 0 && !_unit->allowIcePrefix()) { - // - // For rules controlled by a translator option, we don't complain about included files. - // - if(name.size() >= 3) + DefinitionContextPtr dc = _unit->currentDefinitionContext(); + assert(dc); + if(dc->findMetaData("ice-prefix") != "ice-prefix") // no "ice-prefix" global metadata { - string prefix3; - prefix3 += ::tolower(static_cast<unsigned char>(name[0])); - prefix3 += ::tolower(static_cast<unsigned char>(name[1])); - prefix3 += ::tolower(static_cast<unsigned char>(name[2])); - if(prefix3 == "ice") + if(name.size() >= 3) { - _unit->error("illegal identifier `" + name + "': `" + name.substr(0, 3) + "' prefix is reserved"); + string prefix3; + prefix3 += ::tolower(static_cast<unsigned char>(name[0])); + prefix3 += ::tolower(static_cast<unsigned char>(name[1])); + prefix3 += ::tolower(static_cast<unsigned char>(name[2])); + if(prefix3 == "ice") + { + _unit->error("illegal identifier `" + name + "': `" + name.substr(0, 3) + "' prefix is reserved"); + } } } } |