IsTrue() public method

public IsTrue ( ) : Operand
return Operand
 public IfBlock(Operand condition)
 {
     if (condition.Type != typeof(bool))
     {
         this.condition = condition.IsTrue();
     }
     else
     {
         this.condition = condition;
     }
 }
            public LoopBlock(IStatement init, Operand test, IStatement iter)
            {
                this.init = init;
                this.test = test;
                this.iter = iter;

                if (test.Type != typeof(bool))
                {
                    test = test.IsTrue();
                }
            }
Esempio n. 3
0
            public LoopBlock(IStatement init, Operand test, IStatement iter, ITypeMapper typeMapper)
            {
                _init = init;
                _test = test;
                _iter = iter;

                if (!Helpers.AreTypesEqual(test.GetReturnType(typeMapper), typeof(bool), typeMapper))
                {
                    test = test.IsTrue();
                }
            }
Esempio n. 4
0
 public IfBlock(Operand condition, ITypeMapper typeMapper)
 {
     if (!Helpers.AreTypesEqual(condition.GetReturnType(typeMapper), typeof(bool), typeMapper))
     {
         _condition = condition.IsTrue();
     }
     else
     {
         _condition = condition;
     }
 }
            public void InitializeCondition(Operand test)
            {
                if (ReferenceEquals(test, null))
                {
                    throw new ArgumentNullException(nameof(test));
                }
                if (!ReferenceEquals(_test, null))
                {
                    throw new InvalidOperationException("Loop condition has been already initialized");
                }

                if (!Helpers.AreTypesEqual(test.GetReturnType(_typeMapper), typeof(bool), _typeMapper))
                {
                    test = test.IsTrue();
                }
                _test = test;
            }
			public LoopBlock(IStatement init, Operand test, IStatement iter)
			{
				this.init = init;
				this.test = test;
				this.iter = iter;

				if (test.Type != typeof(bool))
					test = test.IsTrue();
			}
			public IfBlock(Operand condition)
			{
				if (condition.Type != typeof(bool))
					this.condition = condition.IsTrue();
				else
					this.condition = condition;
			}