Commit 96244787 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Exit gracefully if an external function name is used as a model local variable.

Closes #599
parent 1ae4bebf
......@@ -342,6 +342,9 @@ ParsingDriver::add_expression_variable(string *name)
|| mod_file->symbol_table.getType(*name) == eLogTrend)
error("Variable " + *name + " not allowed outside model declaration, because it is a trend variable.");
if (mod_file->symbol_table.getType(*name) == eExternalFunction)
error("Symbol '" + *name + "' is the name of a MATLAB/Octave function, and cannot be used as a variable.");
int symb_id = mod_file->symbol_table.getID(*name);
expr_t id = data_tree->AddVariable(symb_id);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment