Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompileIndexAssignment()

void System.Linq.Expressions.Interpreter.LightCompiler.CompileIndexAssignment ( BinaryExpression node,
bool asVoid )
inlineprivate

Definition at line 391 of file LightCompiler.cs.

392 {
393 IndexExpression indexExpression = (IndexExpression)node.Left;
394 if (indexExpression.Object != null)
395 {
397 }
398 int i = 0;
399 for (int argumentCount = indexExpression.ArgumentCount; i < argumentCount; i++)
400 {
401 Compile(indexExpression.GetArgument(i));
402 }
403 Compile(node.Right);
404 LocalDefinition definition = default(LocalDefinition);
405 if (!asVoid)
406 {
409 }
410 if (indexExpression.Indexer != null)
411 {
412 _instructions.EmitCall(indexExpression.Indexer.GetSetMethod(nonPublic: true));
413 }
414 else if (indexExpression.ArgumentCount != 1)
415 {
417 }
418 else
419 {
421 }
422 if (!asVoid)
423 {
426 }
427 }
static MethodInfo GetArraySetMethod(Type arrayType)
Definition TypeUtils.cs:775
void Compile(Expression expr, bool asVoid)
void UndefineLocal(LocalDefinition definition, int end)
LocalDefinition DefineLocal(ParameterExpression variable, int start)

References System.Linq.Expressions.Interpreter.LightCompiler._instructions, System.Linq.Expressions.Interpreter.LightCompiler._locals, System.Linq.Expressions.Interpreter.LightCompiler.Compile(), System.Linq.Expressions.Interpreter.InstructionList.Count, System.Linq.Expressions.Interpreter.LocalVariables.DefineLocal(), System.Linq.Expressions.Interpreter.InstructionList.EmitAssignLocal(), System.Linq.Expressions.Interpreter.InstructionList.EmitCall(), System.Linq.Expressions.Interpreter.InstructionList.EmitLoadLocal(), System.Linq.Expressions.Interpreter.InstructionList.EmitSetArrayItem(), System.Linq.Expressions.Interpreter.LightCompiler.EmitThisForMethodCall(), System.Dynamic.Utils.TypeUtils.GetArraySetMethod(), System.Linq.Expressions.Expression< TDelegate >.Parameter(), and System.Linq.Expressions.Interpreter.LocalVariables.UndefineLocal().

Referenced by System.Linq.Expressions.Interpreter.LightCompiler.CompileAssignBinaryExpression().