public bool ApplyAssignment(CodeContext codeContext, string leftOfEquals, string rightOfEquals, string newVariableDeclarationType,
AssignmentOperatorType assignmentOperator)
{
bool succeeded = false;
if (newVariableDeclarationType == null && variables.Contains(leftOfEquals))
{
// Circular depenency detected!
AddErrorText("Circular dependency detected on " + leftOfEquals);
}
else
{
variables.Add(leftOfEquals);
try
{
AssignValue(newVariableDeclarationType, leftOfEquals, rightOfEquals, codeContext, assignmentOperator);
succeeded = true;
}
catch (Exception exception)
{
string combined = newVariableDeclarationType + " " + leftOfEquals + " assignment " + rightOfEquals;
AddErrorText("Parse error in: " + combined);
mParserLog.AppendLine("Parse error for line " + combined + "\nException:\n" + exception);
}
variables.Remove(leftOfEquals);
}
return succeeded;
}