Preprocessor: avoid name clashes with model local variables
parent
056dfeb169
commit
e76dfadc78
|
@ -596,7 +596,9 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
||||||
output << ")";
|
output << ")";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
output << datatree.symbol_table.getName(symb_id);
|
/* We append underscores to avoid name clashes with "g1" or "oo_" (see
|
||||||
|
also ModelTree::writeModelLocalVariables) */
|
||||||
|
output << datatree.symbol_table.getName(symb_id) << "__";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eModFileLocalVariable:
|
case eModFileLocalVariable:
|
||||||
|
|
|
@ -1171,7 +1171,9 @@ ModelTree::writeModelLocalVariables(ostream &output, ExprNodeOutputType output_t
|
||||||
if (IS_C(output_type))
|
if (IS_C(output_type))
|
||||||
output << "double ";
|
output << "double ";
|
||||||
|
|
||||||
output << symbol_table.getName(id) << " = ";
|
/* We append underscores to avoid name clashes with "g1" or "oo_" (see
|
||||||
|
also VariableNode::writeOutput) */
|
||||||
|
output << symbol_table.getName(id) << "__ = ";
|
||||||
// Use an empty set for the temporary terms
|
// Use an empty set for the temporary terms
|
||||||
value->writeOutput(output, output_type);
|
value->writeOutput(output, output_type);
|
||||||
output << ";" << endl;
|
output << ";" << endl;
|
||||||
|
|
Loading…
Reference in New Issue