Example #1
0
        protected void HandleIf(TokenList aTokens, string xComparison)
        {
            string xLabel;
            var    xLast = aTokens.Last();

            if (xLast.Value == "{")
            {
                mBlocks.Start(aTokens, false);
                XS.Jump(GetJump(xComparison, true), BlockLabel("End"));
            }
            else
            {
                if (xLast.Matches("return"))
                {
                    xLabel = FuncLabel("Exit");
                }
                else
                {
                    xLabel = GetLabel(xLast);
                }

                XS.Jump(GetJump(xComparison), xLabel);
            }
        }
Example #2
0
        protected void HandleIf(Assembler aAsm, TokenList aTokens, string xComparison)
        {
            string xLabel;
            var    xLast = aTokens.Last();

            if (xLast.Value == "{")
            {
                mBlocks.Start(aTokens, false);
                aAsm += GetJump(xComparison, true) + " " + BlockLabel("End");
            }
            else
            {
                if (xLast.Matches("return"))
                {
                    xLabel = FuncLabel("Exit");
                }
                else
                {
                    xLabel = GetLabel(xLast);
                }

                aAsm += GetJump(xComparison) + " " + xLabel;
            }
        }