Skip to content
Snippets Groups Projects
Verified Commit 0b8e3345 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Ensure that a tag is not declared twice in the same equation

Previously the first value was silently ignored. It’s better to explicitly
forbid this. If this change creates problems (since it’s a change in an
undocumented behaviour), we can turn it into a warning.
parent 81d4fd5d
No related branches found
No related tags found
No related merge requests found
...@@ -279,6 +279,9 @@ ParsingDriver::add_predetermined_variable(const string &name) ...@@ -279,6 +279,9 @@ ParsingDriver::add_predetermined_variable(const string &name)
void void
ParsingDriver::add_equation_tags(string key, string value) ParsingDriver::add_equation_tags(string key, string value)
{ {
if (eq_tags.find(key) != eq_tags.end())
error("Tag '" + key + "' cannot be declared twice for the same equation");
eq_tags[key] = value; eq_tags[key] = value;
transform(key.begin(), key.end(), key.begin(), ::tolower); transform(key.begin(), key.end(), key.begin(), ::tolower);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment