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

◆ TryPushLabelBlock()

bool System.Linq.Expressions.Interpreter.LightCompiler.TryPushLabelBlock ( Expression node)
inlineprivate

Definition at line 1351 of file LightCompiler.cs.

1352 {
1353 switch (node.NodeType)
1354 {
1355 default:
1356 if (_labelBlock.Kind != LabelScopeKind.Expression)
1357 {
1358 PushLabelBlock(LabelScopeKind.Expression);
1359 return true;
1360 }
1361 return false;
1362 case ExpressionType.Label:
1363 if (_labelBlock.Kind == LabelScopeKind.Block)
1364 {
1365 LabelTarget target = ((LabelExpression)node).Target;
1366 if (_labelBlock.ContainsTarget(target))
1367 {
1368 return false;
1369 }
1371 {
1372 return false;
1373 }
1374 }
1375 PushLabelBlock(LabelScopeKind.Statement);
1376 return true;
1377 case ExpressionType.Block:
1379 if (_labelBlock.Parent.Kind != LabelScopeKind.Switch)
1380 {
1382 }
1383 return true;
1384 case ExpressionType.Switch:
1385 {
1387 SwitchExpression switchExpression = (SwitchExpression)node;
1388 foreach (SwitchCase @case in switchExpression.Cases)
1389 {
1390 DefineBlockLabels(@case.Body);
1391 }
1393 return true;
1394 }
1395 case ExpressionType.Convert:
1396 if (!(node.Type != typeof(void)))
1397 {
1398 PushLabelBlock(LabelScopeKind.Statement);
1399 return true;
1400 }
1401 goto default;
1402 case ExpressionType.Conditional:
1403 case ExpressionType.Goto:
1404 case ExpressionType.Loop:
1405 PushLabelBlock(LabelScopeKind.Statement);
1406 return true;
1407 }
1408 }

References System.Linq.Expressions.Interpreter.LightCompiler._labelBlock, System.Linq.Expressions.Interpreter.LabelScopeInfo.ContainsTarget(), System.Linq.Expressions.Interpreter.LightCompiler.DefineBlockLabels(), System.Linq.Expressions.Interpreter.LabelScopeInfo.Kind, System.Linq.Expressions.Interpreter.LabelScopeInfo.Parent, and System.Linq.Expressions.Interpreter.LightCompiler.PushLabelBlock().

Referenced by System.Linq.Expressions.Interpreter.LightCompiler.Compile(), and System.Linq.Expressions.Interpreter.LightCompiler.CompileAsVoid().