コード例 #1
0
        private ConditionalHeader GetComparisonHeader(DelGetCompRegDValue getRegDValue)
        {
            ConditionalHeader header;

            if (ctx.cfg.IsBlockLoopStart(ctx.cfg.FindBlockByInstructionIndex(bci.bciIndexInPrototype)))
            {
                header = new WhileHeader(bci.opcode,
                                         ctx.varNames.GetVariableName(bci.registers.a),
                                         getRegDValue(),
                                         ctx.currentBlock.scope);
            }
            else
            {
                header = new IfHeader(bci.opcode,
                                      ctx.varNames.GetVariableName(bci.registers.a),
                                      getRegDValue(),
                                      ctx.currentBlock.scope);
            }

            return(header);
        }
コード例 #2
0
 public void HandleLua(DelGetCompRegDValue getRegDValue)
 {
     ctx.lua.WriteSrcConstruct(GetComparisonHeader(getRegDValue), ctx.currentBlock.scope);
     ScopifyRangeAndMarkEnd();
     CheckAndMarkElseBlock();
 }