private EXPR BindAssignment(
DynamicMetaObjectBinder payload,
ArgumentObject[] arguments,
Dictionary<int, LocalVariableSymbol> dictionary)
{
if (arguments.Length < 2)
{
throw Error.BindBinaryAssignmentRequireTwoArguments();
}
string name = GetName(payload);
// Find the lhs and rhs.
EXPR indexerArguments = null;
bool bIsCompound = false;
if (payload is CSharpSetIndexBinder)
{
// Get the list of indexer arguments - this is the list of arguments minus the last one.
indexerArguments = CreateArgumentListEXPR(arguments, dictionary, 1, arguments.Length - 1);
bIsCompound = (payload as CSharpSetIndexBinder).IsCompoundAssignment;
}
else
{
bIsCompound = (payload as CSharpSetMemberBinder).IsCompoundAssignment;
}
_symbolTable.PopulateSymbolTableWithName(name, null, arguments[0].Type);
EXPR lhs = BindProperty(payload, arguments[0], dictionary[0], indexerArguments, false);
int indexOfLast = arguments.Length - 1;
EXPR rhs = CreateArgumentEXPR(arguments[indexOfLast], dictionary[indexOfLast]);
if (arguments[0] == null)
{
throw Error.BindBinaryAssignmentFailedNullReference();
}
return _binder.bindAssignment(lhs, rhs, bIsCompound);
}
#endregion