diff options
Diffstat (limited to 'cpp/src/IceGrid/DescriptorHelper.cpp')
-rw-r--r-- | cpp/src/IceGrid/DescriptorHelper.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp index 6ff97d1fd8b..f121c80d614 100644 --- a/cpp/src/IceGrid/DescriptorHelper.cpp +++ b/cpp/src/IceGrid/DescriptorHelper.cpp @@ -125,9 +125,13 @@ DescriptorVariables::hasVariable(const string& name) const void DescriptorVariables::addVariable(const string& name, const string& value) { + if(_scopes.back().parameters.find(name) != _scopes.back().parameters.end()) + { + throw "can't define variable `" + name + "': a parameter with the same was previously defined"; + } if(_scopes.back().used.find(name) != _scopes.back().used.end()) { - throw "you can't redefine the variable `" + name + "' after its use"; + throw "can't redefine variable `" + name + "' after its use"; } _scopes.back().variables[name] = value; } @@ -190,6 +194,10 @@ DescriptorVariables::getCurrentScopeParameters() const void DescriptorVariables::addParameter(const string& name) { + if(_scopes.back().variables.find(name) != _scopes.back().variables.end()) + { + throw "can't declare parameter `" + name + "': a variable with the same was previously defined"; + } _scopes.back().parameters.insert(name); } @@ -674,6 +682,11 @@ ComponentDescriptorHelper::operator==(const ComponentDescriptorHelper& helper) c return false; } + if(_descriptor->variables != helper._descriptor->variables) + { + return false; + } + return true; } |