public override string BuildSql(SqlOptions sqlOptions)
        {
            var operand = Operand.BuildSql(sqlOptions, FlowOptions.Construct(this));
            var command = new TrueOperand().BuildSql(sqlOptions, FlowOptions.Construct(this));

            return($"{operand} = {command}");
        }
Example #2
0
        internal override void CompileBy(FunctionCompiler compiler, bool isLastOperator)
        {
            var endLabel   = compiler.Emitter.DefineLabel();
            var falseLabel = compiler.Emitter.DefineLabel();

            Condition.CompileBy(compiler, false);
            compiler.Emitter.Emit(OpCode.GotoIfFalse, falseLabel);
            TrueOperand.CompileBy(compiler, false);
            compiler.Emitter.Emit(OpCode.Goto, endLabel);
            compiler.Emitter.MarkLabel(falseLabel);
            FalseOperand.CompileBy(compiler, false);
            compiler.Emitter.MarkLabel(endLabel);
            if (isLastOperator)
            {
                compiler.Emitter.Emit(OpCode.Pop);
            }
        }