Пример #1
0
        private void ConvertSwitchSectionBody(Syntax.SwitchSection astSection, ILInstruction bodyInst)
        {
            var body = Convert(bodyInst);

            astSection.Statements.Add(body);
            if (!bodyInst.HasFlag(InstructionFlags.EndPointUnreachable))
            {
                // we need to insert 'break;'
                BlockStatement block = body as BlockStatement;
                if (block != null)
                {
                    block.Add(new BreakStatement());
                }
                else
                {
                    astSection.Statements.Add(new BreakStatement());
                }
            }
        }