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

◆ RewriteSwitchExpression()

Result System.Linq.Expressions.Compiler.StackSpiller.RewriteSwitchExpression ( Expression expr,
Stack stack )
inlineprivate

Definition at line 1056 of file StackSpiller.cs.

1057 {
1058 SwitchExpression switchExpression = (SwitchExpression)expr;
1059 Result result = RewriteExpressionFreeTemps(switchExpression.SwitchValue, stack);
1060 RewriteAction rewriteAction = result.Action;
1062 SwitchCase[] array = null;
1063 for (int i = 0; i < readOnlyCollection.Count; i++)
1064 {
1065 SwitchCase switchCase = readOnlyCollection[i];
1066 Expression[] array2 = null;
1068 for (int j = 0; j < readOnlyCollection2.Count; j++)
1069 {
1071 rewriteAction |= result2.Action;
1072 if (array2 == null && result2.Action != 0)
1073 {
1075 }
1076 if (array2 != null)
1077 {
1078 array2[j] = result2.Node;
1079 }
1080 }
1081 Result result3 = RewriteExpression(switchCase.Body, stack);
1082 rewriteAction |= result3.Action;
1083 if (result3.Action != 0 || array2 != null)
1084 {
1085 if (array2 != null)
1086 {
1088 }
1089 switchCase = new SwitchCase(result3.Node, readOnlyCollection2);
1090 if (array == null)
1091 {
1093 }
1094 }
1095 if (array != null)
1096 {
1097 array[i] = switchCase;
1098 }
1099 }
1100 Result result4 = RewriteExpression(switchExpression.DefaultBody, stack);
1101 rewriteAction |= result4.Action;
1102 if (rewriteAction != 0)
1103 {
1104 if (array != null)
1105 {
1107 }
1108 expr = new SwitchExpression(switchExpression.Type, result.Node, result4.Node, switchExpression.Comparison, readOnlyCollection);
1109 }
1110 return new Result(rewriteAction, expr);
1111 }
Result RewriteExpressionFreeTemps(Expression expression, Stack stack)
Result RewriteExpression(Expression node, Stack stack)

References System.Linq.Expressions.Compiler.StackSpiller.Result.Action, System.array, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Linq.Expressions.Compiler.StackSpiller.Result.Node, System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(), and System.Linq.Expressions.Compiler.StackSpiller.RewriteExpressionFreeTemps().

Referenced by System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression().