Example #1
0
        private void Else()
        {
            var elseScope = new LabeledScope(this);

            _writer.Emit(OpCodes.Br, elseScope.EndLabel);
            PopScope(typeof(LabeledScope), "Else 没有对应的 If");
            PushScope(elseScope);
        }
Example #2
0
        public void If(Func <LogicOperator> condition)
        {
            if (condition == null)
            {
                throw new ArgumentNullException("condition");
            }

            var c       = condition();
            var ifScope = new LabeledScope(this);

            GoToIf(c.Negate(), ifScope.EndLabel);
            PushScope(ifScope);
        }